Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper Tools . Books 1-3 - <b>fileattr()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 FILEATTR()
 Determines a file's attributes
------------------------------------------------------------------------------
 Syntax

     FILEATTR([<cFile>]) --> nFileAttr

 Argument

     <cFile>  Designates the file name, including the path and drive
     designation.

 Returns

     FILEATTR() returns the attributes for the researched entry or the
     attribute from the FILESEEK() buffer (when called without a parameter).

 Description

     FILEATTR() is implemented alone or in conjunction with FILESEEK().  If
     the function is called with the <cFile> parameter, it returns the
     attribute of the first entry found.  If no acceptable entry is
     available, a value of 0 is returned.

     When called without a parameter, FILEATTR() returns the attribute for
     the most-recent file located with FILESEEK().  When used with
     FILESEEK(), you can determine the attribute for file groups (wildcards).

     When you call FILEATTR() with the <cFile> parameter, the function
     internally passes 63 (all attributes) as a mask.  When used in
     conjunction with FILESEEK(), you should also designate all 63 as an
     attribute mask, if all files are to be acknowledged.

     Table 7-11:  Coding the File Attribute
     ------------------------------------------------------------------------
     Value   Symb. constants     Assigned attribute
     ------------------------------------------------------------------------
     0       FA_NORMAL
     1       FA_READONLY         READ ONLY (Read-only)
     2       FA_HIDDEN           HIDDEN (Hidden files)
     4       FA_SYSTEM           SYSTEM (System files)
     8       FA_VOLUME           VOLUME (Name of a floppy/hard disk)
     16      FA_DIRECTORY        DIR (Directory)
     32      FA_ARCHIVE          ARCHIVE (Changes since last backup)
     ------------------------------------------------------------------------

     If multiple attributes are implemented for a file, the value of each
     corresponding attribute is added.

 Examples

     .  Show the attribute of a specific file:

        ? FILEATTR("C:\TEXT\TEXT.TXT")      // 32  ARCHIVE

     .  The attribute for an ARCHIVE/HIDDEN file:

        ? FILEATTR("C\HIDE.TXT")            // 34  HIDDEN + ARCHIVE

     .  Used in conjunction with FILESEEK():

        cFile  :=  FILESEEK("C:\TEXT\TEXT.TXT")
        DO WHILE .NOT. EMPTY (cFile)
           ? cFile, FILEATTR()              // Name & file attribute
           cFile  :=  FILESEEK()            // Search for next entry
        ENDDO


See Also: FILESEEK() FILEDATE() FILESIZE() FILETIME()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson