Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

Get file attributes

   1  
   2      attr: func [
   3          {Return current attributes for the file.}
   4          file [file!]
   5          /with   {Retrieve only selected attributes.}
   6              sel {Selected attributes to retrieve.}
   7          /avail  {Return a list of attributes available for the file.}
   8          /copy   {Copy all attributes, which are safe to copy, to f2.}
   9              f2 [file!]
  10          /local a
  11      ][
  12          if with  [return get-modes file sel]
  13          if avail [return get-modes file 'file-modes]
  14          if copy  [
  15              ;set-modes f2 a: get-modes file get-modes file 'copy-modes
  16              ; Core 2.5 includes full-path, which it shouldn't
  17              ;set-modes f2 a: get-modes file exclude get-modes file 'copy-modes [full-path]
  18              set-modes f2 a: get-modes file get-modes file 'copy-modes
  19              return a
  20          ]
  21          get-modes file get-modes file 'file-modes
  22      ]
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS