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

Changeset 3345

Show
Ignore:
Timestamp:
03/13/08 03:20:37 (9 months ago)
Author:
lmartin92
Message:

3 classes in FtpFolder? of Tango Vfs is now finished

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/lmartin/ftp/tango/io/vfs/FtpFolder.d

    r3344 r3345  
    2929 
    3030private import tango.net.ftp.FtpClient; 
     31 
     32//deals with creating null files(what I use it for) 
     33private import tango.io.FileConduit; 
    3134 
    3235//imports things to deal with text 
     
    189192        } 
    190193        else 
    191             return this
     194            return new FtpFolder(this)
    192195    } 
    193196 
     
    245248    { 
    246249        _ftp.close(); 
    247         return this
     250        return new FtpFolder(this)
    248251    } 
    249252 
     
    576579    VfsFile copy (VfsFile source) 
    577580    { 
    578         return null; 
     581        InputStream istream = source.input; 
     582        this.create(); 
     583        OutputStream os = this.output; 
     584        void[] dest; 
     585        istream.read(dest); 
     586        os.write(dest); 
     587        return new FtpFile(this, _toString); 
    579588    } 
    580589 
     
    587596    VfsFile move (VfsFile source) 
    588597    { 
    589         return null; 
     598        copy(source); 
     599        source.remove(); 
     600        return new FtpFile(this, _toString); 
    590601    } 
    591602 
     
    599610    { 
    600611        _folder._ftp.del(this.toString); 
    601         return create(null); //needs to replace null with an empty stream 
     612        FileConduit.Style style; 
     613        style.access = FileConduit.Access.ReadWrite; 
     614        style.cache = FileConduit.Cache.None; 
     615        style.open = FileConduit.Open.Create; 
     616        style.share = FileConduit.Share.None; 
     617        FilePath mfp = new FilePath(""); 
     618        mfp.set(mfp.root ~ "//NF"); 
     619        FileConduit fs = new FileConduit(mfp, style); 
     620        byte[] src; 
     621        src ~= cast(byte)1; 
     622        src ~= cast(byte)1; 
     623        fs.write(src); 
     624        return create(fs); //needs to replace null with an empty stream 
    602625    } 
    603626 
     
    636659    InputStream input () 
    637660    { 
    638         return null; 
     661        InputStream istream = _folder._ftp.input; 
     662        prepareInputStream(_folder._ftp, istream, FtpCommand.RETR, ["", _toString]); 
     663        return istream; 
    639664    } 
    640665 
     
    648673    OutputStream output () 
    649674    { 
    650         return null; 
    651     } 
    652  
    653     /*********************************************************************** 
    654  
    655         Duplicate this entry 
     675        OutputStream os = _folder._ftp.output; 
     676        prepareOutputStream(_folder._ftp, os, FtpCommand.STOR, ["", _toString]); 
     677        return os; 
     678    } 
     679 
     680    /*********************************************************************** 
     681 
     682        Returns a copy of this instance; 
     683        Does not copy file. 
    656684 
    657685    ***********************************************************************/