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> novattval()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 NovAttVal()
------------------------------------------------------------------------------
 Purpose:
 Convert file and directory attributes from a string to a value format.

 Syntax:
 dwValue = NovAttVal( lpszValue )

 Parameters:
 lpszValue  The character string representation of the attribute.

 Returns:
 A numeric value (unsigned long).

 Description:
 NovAttVal() is used to convert a character string rights representation
 into a numeric attribute value. The character string passed to this
 function must contain either the appropriate rights characters in the
 correct positions  or spaces in the positions that do not have a
 particular attribute.

 The complete character string of attributes is:
 RoSAEHSyITPRaWaCDR

 Attribute                           Position

 Ro = Read Only / Rw = Read Write    1-2
 S  = Shareable                      3
 A  = Archive                        4
 E  = Execute only                   5
 H  = Hidden                         6
 Sy = System                         7-8
 I  = Indexed                        9
 T  = Transactional                  10
 P  = Purgeable                      11
 Ra = Read Audit                     12-13
 Wa = Write Audit                    14-15
 C  = Copy Inhibit                   16
 D  = Delete Inhibit                 17
 R  = Rename Inhibit                 18

 Example:
 // To make the file SYS:PUBLIC\WP.DOC read only using the
 // character mask:
 dwAttrib = FilAttGet( "SYS:PUBLIC\WP.DOC" )
 lpszMask = NovAttStr( dwAttrib )
 if ( dwAttrib != NOVERRLONG )
    ? "The file attributes of SYS:PUBLIC\WP.DOC are", lpszMask
    lpszMask[2] = "o"       // change to read only
    dwNewAttrib = NovAttVal( lpszMask )
    dwOldAttrib = FilAttSet( "SYS:PUBLIC\WP.DOC", dwNewAttrib )
    if ( dwOldAttrib != NOVERRLONG )
       ? "The file attributes of SYS:PUBLIC\WP.DOC "
       ?? "are now changed to", NovAttStr( dwNewAttrib )
    endif
 endif

See Also: NovAttStr() FilAttGet() / FilAttSet() DirAttGet() / DirAttSet() DflAttGet()

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