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

Load file info for all files in a directory (See related posts)

    load-dir: func [
        "Load file info for all files in a directory."
        path /local result orig-dir
    ][
        result: copy []
        orig-dir: what-dir
        change-dir dirize path
        foreach file read %. [
            repend result [
                file
                ;file: get-modes file 'full-path
                make info? file  get-modes file get-modes file 'file-modes
            ]
            ; include # of files in sub-dirs?
            ; include full-path?
        ]
        change-dir orig-dir
        result
    ]


You need to create an account or log in to post comments to this site.


Click here to browse all 5147 code snippets

Related Posts