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

    attr: func [
        {Return current attributes for the file.}
        file [file!]
        /with   {Retrieve only selected attributes.}
            sel {Selected attributes to retrieve.}
        /avail  {Return a list of attributes available for the file.}
        /copy   {Copy all attributes, which are safe to copy, to f2.}
            f2 [file!]
        /local a
    ][
        if with  [return get-modes file sel]
        if avail [return get-modes file 'file-modes]
        if copy  [
            ;set-modes f2 a: get-modes file get-modes file 'copy-modes
            ; Core 2.5 includes full-path, which it shouldn't
            ;set-modes f2 a: get-modes file exclude get-modes file 'copy-modes [full-path]
            set-modes f2 a: get-modes file get-modes file 'copy-modes
            return a
        ]
        get-modes file get-modes file 'file-modes
    ]
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS