Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Novlib 3.30 Online Reference - <b> filattributeget() / filattributeset()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 FilAttributeGet() / FilAttributeSet()
------------------------------------------------------------------------------
 Purpose:
 Get or set the file attributes.

 Syntax:
 dwAttrib = FilAttributeGet( lpszPath )
 dwAttrib = FilAttributeSet( lpszPath, dwNewAttrib )

 Parameters:
 lpszPath    The full NetWare directory path of the file.
 dwNewAttrib The new attribute mask value.

 Returns:
 A numeric value (unsigned long int).

 The CA-Clipper names for these functions are:
 FilAttGet() / FilAttSet()

 Description:
 FilAttributeGet() returns the extended file attributes of the file
 specified by lpszPath. lpszPath must be the complete path including
 the volume name, e.g. SYS:DATA\WP\KATIE.DOC. Returns a numeric value
 containing a mask of the extended attributes.

 FilAttributeSet() sets the attributes of the specified file lpszPath to
 dwNewAttrib and returns the previous value. Returns NOVERRLONG if an error
 occurs.

 The rights can be determined from this table.

 Value returned         Hex         Decimal
 NORMAL                 0x00000000  0
 READ ONLY              0x00000001  1
 HIDDEN                 0x00000002  2
 SYSTEM                 0x00000004  4
 EXECUTE ONLY           0x00000008  8
 ARCHIVE                0x00000020  32
 EXECUTE CONFIRM        0x00000040  64
 SHAREABLE              0x00000080  128
 SEARCH LOW             0x00000100  256
 SEARCH MID             0x00000200  512
 SEARCH HIGH            0x00000400  1024
 TRANSACTIONAL          0x00001000  4096
 INDEXED                0x00002000  8192
 READ AUDIT             0x00004000  16384
 WRITE AUDIT            0x00008000  32768
 IMMEDIATE PURGE(386)   0x00010000  65536
 RENAME INHIBIT (386)   0x00020000  131072
 DELETE INHIBIT (386)   0x00040000  262144
 COPY INHIBIT (386)     0x00080000  524288

 Example:
 // To return the attributes mask of file "SYS:DATA\WP\KATIE.DOC":

 dwCurrAttrib = FilAttributeGet( "SYS:DATA\WP\KATIE.DOC" )
 if ( dwCurrAttrib != NOVERRLONG )
    ? "The attributes mask of SYS:DATA\WP\KATIE.DOC is "
    ??  NovAttributeString( dwCurrAttrib )
 endif

 // To change the attributes of the file SYS:DATA\KATIE.DOC to include the
 // Transactional flag:

 dwCurrAttrib = FilAttributeGet( "SYS:DATA\KATIE.DOC" )
 if ( dwCurrAttrib != NOVERRLONG )
    dwNewAttrib = dwCurrAttrib + 4096
    FilAttributeSet( "SYS:DATA\KATIE.DOC", dwNewAttrib)
    ? "The attributes mask of SYS:DATA\KATIE.DOC is now"
    ?? "["+ NovAttributeString( dwNewAttrib )+ "]"
 endif

 Notes:
 Appropriate trustee access rights are required to use these
 functions.

See Also: DirAttributeGet() / DirAttributeSet() NovAttributeString()

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