All pastes #753036 Raw Edit

Something

public c v1 · immutable
#753036 ·published 2007-10-28 22:14 UTC
rendered paste body
void main(){        auto root = new FileFolder (r"d:\d\import\temp", true);        root.folder("test").create;        root.file("test.txt").create(new Buffer("hello"));        Stdout.formatln ("test.txt.length = {}", root.file("test.txt").size);                //root = new FileFolder (r"c:\");        auto set = root.self;        Stdout.formatln ("self.files = {}", set.files);        Stdout.formatln ("self.folders = {}", set.folders);        Stdout.formatln ("self.entries = {}", set.entries);        Stdout.formatln ("self.contents = {}", set.contents);        set = root.children;        Stdout.formatln ("child.files = {}", set.files);        Stdout.formatln ("child.folders = {}", set.folders);        Stdout.formatln ("child.entries = {}", set.entries);        Stdout.formatln ("child.contents = {}", set.contents);        foreach (folder; set)                 Stdout.formatln ("child.folder '{}' has {} files", folder.name, folder.self.files);        auto files = set.files ("foo.txt");        Stdout.formatln ("fileset.entries = {}", files.entries);        Stdout.formatln ("fileset.contents = {}", files.contents);        foreach (file; files)                 Stdout.formatln ("fileset.file '{}'", file.name);}===============================================test.txt.length = 5self.files = 1self.folders = 3self.entries = 4self.contents = 5child.files = 5child.folders = 4child.entries = 9child.contents = 27child.folder 'bar' has 0 fileschild.folder 'Copy of test' has 1 fileschild.folder 'test' has 2 fileschild.folder 'test' has 1 filesfileset.entries = 1fileset.contents = 11fileset.file 'foo.txt'