Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - findfattr() return file attributes after a file find http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 findfattr()         Return file attributes after a file find
------------------------------------------------------------------------------
 Declaration
   file.hdr

 Syntax
   func uint findfattr extern

 Arguments
   None.

 Return
   An integer representing the file attributes.

 Description
   The findfattr() function returns the file, disk or volume attribute from
   the last findfirst() or findnext() function call.

   The attributes are indicated by bits set or reset in the returned value:

   bit  7 6 5 4 3 2 1 0
       +---------------+
       |-|-|a|d|v|s|h|r|
       +---------------+
            | | | | | |
            | | | | | +-- read only     (1)
            | | | | +---- hidden        (2)
            | | | +------ system        (4)
            | | +-------- volume label  (8)
            | +---------- directory    (16)
            +------------ archive      (32)

   If a file has set more than one attribute, the return value is a
   combination (sum) of the values above.

 Example
   #define EXAMPLE_FILE
   #include example.hdr

   vardef
      char(10) aAttr[6] := "Readonly  ", "Hidden    ", "System    ", ;
                           "Volume    ", "Directory ", "Archive   "
   enddef
   
   proc Test_findfattr
   vardef
      char cData
      uint uAttr
      uint n
   enddef
   ? "File name      Attributes"
   if findfirst( curdir( 0 ) + "\*.*", FIND_ANYFILE )
      repeat
         cData := padr( findfstr(), 15, ' ' )
         uAttr := findfattr()
         for n := 0 to 5
            if testbit( uAttr, n )
               cData += aAttr[ n ]
            endif
         next
         ? cData
      until .not. findnext()
   endif
   endproc

   proc main
   Test_findfattr()
   endproc

See Also: findfdate() findfext() findfsize() findfstr() findftime()

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