view tango/example/conduits/filebubbler.d @ 270:d9d5d59873d8 trunk

[svn r291] Fixed a bunch of the old Phobos tests to work with Tango. Branch statements now emit a new block after it. Fixed the _adSort runtime function had a bad signature. Added a missing dot prefix on compiler generated string tables for string switch. Fixed, PTRSIZE seems like it was wrong on 64bit, now it definitely gets set properly.
author lindquist
date Mon, 16 Jun 2008 16:01:19 +0200
parents 1700239cab2e
children
line wrap: on
line source


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;
}