132
|
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
|