Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FUNCky - <b>name:</b> <b>fsetattr() - set a files attribute</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Name:     fsetattr() - set a files attribute
  Usage:    [<logical>] = fsetattr(<filename>,<attrib>,[<mode>])
  Params:   string <filename> - the file name to set
            integer <attrib> - the attribute to set
            integer <mode> - 1 to set on, 0 to set off. If left out
            then the default is to turn on the attribute bit.

            valid attributes are:

                 Bit  - Decimal -    When On

                 0    -    0    -    normal file
                 0    -    1    -    read only
                 1    -    2    -    hidden file
                 2    -    4    -    system file
                 5    -    32   -    archive bit

  Returns:  logical .T. if attribute changed successfully, .F. if error

 ---------------------------------- Example ---------------------------------

                 fsetattr("employee.dbf",1,1)
                 * sets the file to read only

                 fsetattr("employee.dbf",1,0)
                 * sets the file to normal

                 fsetattr("employee.dbf",7,1)
                 * sets the file to read only hidden and system

  Note:     The attributes are BIT settings. You must turn on
            the appropriate bits to set the attribute. If the
            attribute is 7, then you must turn bits 0, 1, 2 off
            to change the file's attribute back to normal. You
            can use the test() function to check if individual
            bits are on or off. You cannot set the volume label
            or subdirectory attributes.


See Also: fgetattr() fprotect() fhide() fchanged() ferror()

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