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 sub-directories (See related posts)

    dirs: func [
        {Returns a block of fully qualified subdirectories 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 [
            if dir? f-spec: join spec file [
                append block f-spec
                if deep [all-dirs/deep f-spec block]
            ]
        ]
        block
    ]

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


Click here to browse all 5059 code snippets

Related Posts