/myftp

A simple FTP server & client written in C.

Primary LanguageC

myftp

  • A simple FTP server & client written in C.
    • Created for a class assignment 🧠

Demo

Screen Shot 2022-10-18 at 8 03 58

Packet Format

Screen Shot 2022-10-19 at 2 04 39

How to run

  • Build
make build
  • Server
    • When a server (myftpd) receives a request for a TCP connection request, it forks() and the child process accepts subsequent command messages from the client.
./myftpd <dir>
  • Client
    • Once a TCP connection is established, a client (myftpc) displays the prompt "myFTP%" and waits for user input.
./myftpc <IP>

Commands

command args description
quit quit the program
pwd print current directory
cd path change current directory
dir path list current directory
lpwd print client current directory
lcd path change client current directory
ldir path list client current directory
get path1 path2 get the file of 'path1' from server and save to 'path2'
put path1 path2 put file of 'path1' to server and save to 'path2'
help print help message