Mercurial > projects > ldc
diff tango/example/conduits/filebubbler.d @ 132:1700239cab2e trunk
[svn r136] MAJOR UNSTABLE UPDATE!!!
Initial commit after moving to Tango instead of Phobos.
Lots of bugfixes...
This build is not suitable for most things.
author | lindquist |
---|---|
date | Fri, 11 Jan 2008 17:57:40 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tango/example/conduits/filebubbler.d Fri Jan 11 17:57:40 2008 +0100 @@ -0,0 +1,30 @@ + +private import tango.io.Console, + tango.io.FileScan, + tango.io.FileConst; + +/******************************************************************************* + + This example sweeps a named sub-directory tree for html files, + and moves them to the current directory. The existing directory + hierarchy is flattened into a naming scheme where a '.' is used + to replace the traditional path-separator + + Used by the Tango project to help manage renderings of the source + code. + +*******************************************************************************/ + +void main(char[][] args) +{ + // sweep all html files in the specified subdir + if (args.length is 2) + foreach (proxy; (new FileScan).sweep(args[1], ".html").files) + { + auto other = new FilePath (proxy.toString); + proxy.rename (other.replace (FileConst.PathSeparatorChar, '.')); + } + else + Cout ("usage is filebubbler subdir").newline; +} +