Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Changeset 3551

Show
Ignore:
Timestamp:
06/03/08 17:30:36 (6 months ago)
Author:
kris
Message:

migrating from FileScan? to vfs.FileFolder?

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/example/conduits/createzip.d

    r3128 r3551  
    22 
    33import tango.io.archive.Zip; 
    4 import tango.io.FileScan; 
    5 import tango.io.Stdout; 
     4import tango.io.vfs.FileFolder; 
    65 
    76/****************************************************************************** 
     
    1413******************************************************************************/ 
    1514 
    16 void main(){ 
    17     auto scan = (new FileScan)(".", ".d"); 
    18     char[][] files; 
    19     foreach (file; scan.files)  
    20         files ~= file.toString; 
     15void main() 
     16
     17        char[][] files; 
     18        auto root = new FileFolder ("."); 
     19        foreach (file; root.tree.catalog ("*.d")) 
     20                 files ~= file.toString; 
    2121 
    22     createArchive("tmp.zip", Method.Deflate, files); 
     22        createArchive("tmp.zip", Method.Deflate, files); 
    2323} 
  • trunk/example/conduits/filebubbler.d

    r3547 r3551  
    11 
    22private import  tango.io.Console, 
    3                 tango.io.FileScan, 
    4                 tango.io.model.IFile; 
     3                tango.io.model.IFile, 
     4                tango.io.vfs.FileFolder; 
     5 
     6private import  Path = tango.io.Path; 
    57 
    68/******************************************************************************* 
     
    1921{ 
    2022        // 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                     } 
     23        if (args.length !is 2) 
     24            Cout ("usage is filebubbler subdir").newline; 
    2725        else 
    28            Cout ("usage is filebubbler subdir").newline; 
     26           foreach (file; (new FileFolder(args[1])).tree.catalog("*.html")) 
     27                    Path.rename (file.toString, Path.replace (file.toString.dup, FileConst.PathSeparatorChar, '.')); 
    2928} 
    3029