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-2 of 2 total  RSS 

Delete empty directories (UNIX)

// Shell command to delete empty directories. May have to run several times to get everything.

find . -type d -empty | xargs rmdir -

Get all sub-directories

    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
    ]
« Newer Snippets
Older Snippets »
Showing 1-2 of 2 total  RSS