Mercurial > projects > ldc
comparison 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 |
comparison
equal
deleted
inserted
replaced
131:5825d48b27d1 | 132:1700239cab2e |
---|---|
1 | |
2 private import tango.io.Console, | |
3 tango.io.FileScan, | |
4 tango.io.FileConst; | |
5 | |
6 /******************************************************************************* | |
7 | |
8 This example sweeps a named sub-directory tree for html files, | |
9 and moves them to the current directory. The existing directory | |
10 hierarchy is flattened into a naming scheme where a '.' is used | |
11 to replace the traditional path-separator | |
12 | |
13 Used by the Tango project to help manage renderings of the source | |
14 code. | |
15 | |
16 *******************************************************************************/ | |
17 | |
18 void main(char[][] args) | |
19 { | |
20 // sweep all html files in the specified subdir | |
21 if (args.length is 2) | |
22 foreach (proxy; (new FileScan).sweep(args[1], ".html").files) | |
23 { | |
24 auto other = new FilePath (proxy.toString); | |
25 proxy.rename (other.replace (FileConst.PathSeparatorChar, '.')); | |
26 } | |
27 else | |
28 Cout ("usage is filebubbler subdir").newline; | |
29 } | |
30 |