Code Monkey home page Code Monkey logo

ftp's Introduction

feature: 1. list file in current directory and also show the structure(position) of the directory

        python3 client_ftp.py [hostname] [Pconnect_Port] -l [Qconnect_port]
    

    2. send short or long file to server
        
        python3 client_ftp.py [hostname] [Pconnect_Port] -g [file_sent]  [Qconnect_port]
        // send [file_sent] into server, and save the content in a file named receivedfile
        python3 client_ftp.py [hostname] [Pconnect_Port] -g [file_sent]  [file_recevie] [Qconnect_port] 
        //send [file_sent] into server, and save content in [file_received]    (whatever the file_received exist or not)
         
    3. make directory in current directory
             
        python3 client_ftp.py [hostname] [Pconnect_Port] -m [new directory name]  [Qconnect_port]
    
    4. create new file  in current directory
             
        python3 client_ftp.py [hostname] [Pconnect_Port] -f [new file name]  [Qconnect_port]
    
    5. change the position in any directory structure. which is as cd command in linux   
             
        python3 client_ftp.py [hostname] [Pconnect_Port] -c [positon want to go]  [Qconnect_port]
        // in server end, it shows the current position after changed by client
    6. delete the file and directory in server side
       python3 client_ftp.py [hostname] [Pconnect_Port] -d [path_name]  [Qconnect_port]
       // path name is the path name of file or directory that you want to delete 

extra credit completed: 1. send file without txt extension 2. change directory positon 3. make new file, the client can send the file to that new file in server 4. make new directory 5. server side get IP address from client. 6. password Text code:

 server end $   hostname                            
                flip1.engr.oregonstate.edu          
            $   gcc server.c -o server_ftp                    
            $   ./server_ftp 8991                            $  python3 client_ftp.py flip1 8991 -l 32262
                                                           

  client end $   password: 123456
             $   python3 client_ftp.py flip1 8991 -l 32262            // list files in current directory
             $   python3 client_ftp.py flip1 8991 -f newfile 32262    // create a empty newfile in current directory 
             $   python3 client_ftp.py flip1 8991 -g shortext 32262   // send a short textfile to server  
             $   python3 client_ftp.py flip1 8991 -g shortext newfile 32262 // send a shortext to server's newfile
             $   python3 client_ftp.py flip1 8991 -c ../ 32262        // change current directory position to up level 
                                                                      // cd ../
             $   python3 client_ftp.py flip1 8991 -m newer 32262     // create a empty newdir in current directory 
                                                                     // because -c change the position into up level
                                                                     // newdir is in up level type cd .. to look at it
             $   python3 client_ftp.py flip1 8991 -f new_file 32262    // create a empty newfile in current directory 
             $   python3 client_ftp.py flip1 8991 -d new_file 32262   // delete a new_file in current directory 


             the program also can send long text.

*hint because -c may cause that server end is not at the same level as the server.c -l could help you know where the sever end is. check it before you transfer data. reference from : apue book

ftp's People

Contributors

maoyihui avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.