[<<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()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson