Delphis's FindFirst, FindNext returns attributes for the returned
files/dirs.

TSearchRec defines file information searched for by FindFirst or FindNext.

Unit

SysUtils

type
TFileName = string;
TSearchRec = record
                Time: Integer;
                Size: Integer;
                Attr: Integer;
                Name: TFileName;
                ExcludeAttr: Integer;
                FindHandle: THandle;
                FindData: TWin32FindData;
end;

Description

The TSearchRec type defines file information searched for by a FindFirst or
FindNext function call. If a file is found, the fields of the TSearchRec
type parameter are modified to specify the found file.

Attr represents the file attributes the file attributes of the file. Test
Attr against the following attribute constants or values to determine if a
file has a specific attribute:

Constant        Value   Description

faReadOnly      $00000001       Read-only files
faHidden        $00000002       Hidden files
faSysFile       $00000004       System files
faVolumeID      $00000008       Volume ID files
faDirectory     $00000010       Directory files
faArchive       $00000020       Archive files
faAnyFile       $0000003F       Any file

To test for an attribute, combine the value of the Attr field with the
attribute constant with the and operator. If the file has that attribute,
the result will be greater than 0. For example, if the found file is a
hidden file, the following expression will evaluate to True: (SearchRec.Attr
and faHidden > 0).

Time contains the time stamp of the file. Size contains the size of the file
in bytes. Name contains the DOS file name and extension.  FindData contains
additional information such as the file creation time, last access time, and
both the long and short file names.


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Patrick Dunford
Sent: Tuesday, 15 June 1999 22:42
To: Multiple recipients of list delphi
Subject: RE: [DUG]: Destiguishing Directories from files


The API function to call is FindFirstFile. Like Delphi's own FindFirst, it
returns attributes that include whether something is a directory or not.

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Jeremy Coulter
> Sent: Tuesday, 15 June 1999 21:53
> To: Multiple recipients of list delphi
> Subject: [DUG]: Destiguishing Directories from files
>

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to