DZone 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

Snippets has posted 5883 posts at DZone. View Full User Profile

Load File Info For All Files In A Directory

01.22.2006
| 2837 views |
  • submit to reddit
        
    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
    ]