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>fgetattr() - get a files attribute</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Name:     fgetattr() - get a files attribute
  Usage:    <integer> = fgetattr(<filename>)
  Params:   string <filename> - the file name to get attributes of
  Returns:  integer equal to the files attribute

            valid attributes are:

                 Bit  - Decimal -    When On

                 0    -    0    -    normal file
                 0    -    1    -    read only
                 1    -    2    -    hidden file
                 2    -    4    -    system file
                 3    -    8    -    volume label
                 4    -    16   -    subdirectories
                 5    -    32   -    archive bit

            Each number corresponds to a bit in the file attribute.
            Use the test() function to test if the bit you are
            interested in is on or not.

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

                 fattr = fgetattr("employee.dbf")
                 if test(fattr,1)
                      ? "file is marked read only"
                 endif
                 if test(fattr,16)
                      ? "employee.dbf is a subdirectory"
                 endif

  Note:     The attributes are BIT settings. If the attribute is 7,
            then bits 0, 1, 2 are set to 1. You can use the test()
            function to check if individual bits are on or off.


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

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