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

Changeset 3465

Show
Ignore:
Timestamp:
04/26/08 05:48:21 (7 months ago)
Author:
lmartin92
Message:

Now I've tested every non-data socket method that I have included in this file on my own FtpServer?. Prerequisites for working program is an FtpServer? set to localhost and the files specified in the program. It connects, removes dirs, removes files, renames files, gets sizes of files, gets modification dates of files now.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/lmartin/ftp/tango/net/ftp/FtpClient.d

    r3447 r3465  
    868868debug(UnitTest) { 
    869869    import tango.io.Stdout; 
     870    import tango.io.Console; 
    870871 
    871872    void main() { 
    872873        Stdout("Testing the new parts in FtpClient.d").newline.flush; 
    873         FTPConnection conn = new FTPConnection("ftp.digitalmars.com"); 
     874        FTPConnection conn = new FTPConnection("localhost", "me", "pass", 21); 
    874875        Stdout("Connecting works!").newline.flush; 
    875     } 
    876 
     876        Stdout("Making directory SS.").newline.flush; 
     877        conn.mkdir("/SS"); 
     878        Stdout("Setting current directory to SS.").newline.flush; 
     879        conn.cd("/SS"); 
     880        Stdout("Setting current directory to parent directory.").newline.flush; 
     881        conn.cdup(); 
     882        Stdout("Removing directory SS.").newline.flush; 
     883        conn.rm("/SS"); 
     884        Stdout("Gettign size of file.").newline.flush; 
     885        long size = conn.size("ServingSchedule.tif"); 
     886        Stdout("The size of the file is: "); 
     887        Stdout(size).newline.flush; 
     888        Stdout("Renaming the file to No.").newline.flush; 
     889        conn.rename("ServingSchedule.tif", "No"); 
     890        Stdout("Getting the mod date.").newline.flush; 
     891        Time* modified = conn.modified("No"); 
     892        Stdout("The file was modified: "); 
     893        Stdout(modified).newline.flush; 
     894        Stdout("Press enter.").newline.flush; 
     895        Cin.get(); 
     896        Stdout("Deleting the file No.").newline.flush; 
     897        conn.del("No"); 
     898        conn.close(); 
     899        Stdout("Finished.").newline.flush; 
     900    } 
     901