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

Get all files in dir, fully qualified (See related posts)

    all-files: func [
        {Returns a block of fully qualified filenames for the directory.}
        spec  [file!]   "Starting Directory"
        block [block!]  "Block to append to"
        /deep           "Recurse sub-directories."
        /local f-spec
    ][
        spec: dirize spec
        foreach file read spec [
            f-spec: join spec file
            either all [deep dir? f-spec] [
                all-files/deep f-spec block
            ][
                append block f-spec
            ]
        ]
        block
    ]

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


Click here to browse all 5140 code snippets

Related Posts