On Thu, Jun 21, 2007 at 09:48:56PM +0400, Alex Smirnov wrote:
> Peter Vreman ?????:
> >If need performance and only need to have the filename you can use 
> >fpgetdents or the deprecated
> >fpreaddir. If you need all file information like size and modified 
> >timestamp then better use the
> >portable findfirst/findnext.
> >  
> *Thank you, Peter!
> 
> * Can you. please, help me to understand Dir structure, i.e

The FreeBSD source has some comments

  dir     = packed record
        dd_fd     : cint;         // file descriptor associated with directory
        dd_loc    : clong;        // offset in current buffer
        dd_size   : clong;        // amount of data returned by
        getdirentries
        dd_buf    : pchar;        // data buffer
        dd_len    : cint;         // size of data buffer
{$ifdef netbsdpowerpc}
        dd_pad1   : cint;
        dd_seek   : cint64;        // magic cookie returned by getdirentries
{$else}
        dd_seek   : clong;        // magic cookie returned by getdirentries
{$endif}
        dd_rewind : clong;        // magic cookie for rewinding
        dd_flags  : cint;         // flags for readdir
   end;
   TDir    = dir;
   pDir    = ^dir;

However I would vote against using it. Sure it saves a stat here and there,
but it is way less portable (even amongst *nixes in time) than findfirst.

> <http://freepascal.org/docs-html/rtl/baseunix/pdirent.html>;

Keep in mind that the docs only show the Linux structures and functions for
the *nix units.
 

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to