License:
Version:
Author:
1 2 3 4 5 6 7 8 | // count of files in this folder auto count = folder.self.files; // accumulated file byte-count auto bytes = folder.self.bytes; // a group of one folder (itself) auto folders = folder.self; |
1 2 3 4 5 6 7 8 | // count of files in this tree auto count = folder.tree.files; // accumulated file byte-count auto bytes = folder.tree.bytes; // the group of child folders auto folders = folder.tree; |
1 2 3 4 5 | // select a subset of the resultant tree auto folders = folder.tree.subset("install"); // get total file bytes for a tree subset, using wildcards auto bytes = folder.tree.subset("foo*").bytes; |
1 2 3 4 5 6 7 8 9 10 11 | // files called "readme.txt" in this folder auto count = folder.self.catalog("readme.txt").files; // files called "read*.*" in this tree auto count = folder.tree.catalog("read*.*").files; // all txt files belonging to folders starting with "ins" auto count = folder.tree.subset("ins*").catalog("*.txt").files; // custom-filtered files within a subtree auto count = folder.tree.catalog(&filter).files; |
1 2 3 4 5 6 7 8 | foreach (folder; root.tree) Stdout.formatln ("folder name:{}", folder.name); foreach (folder; root.tree.subset("ins*")) Stdout.formatln ("folder name:{}", folder.name); foreach (file; root.tree.catalog("*.d")) Stdout.formatln ("file name:{}", file.name); |
1 2 3 | root.folder("myNewFolder").create; root.folder("myExistingFolder").open; |
1 2 3 4 | root.file("myNewFile").create; auto source = root.file("myExistingFile"); root.file("myCopiedFile").copy(source); |