- make : Create the executables, distribute them to clusters. Intialize the content of clusters.
- make start_server : Start clusters and master server in the background.
- make client : Lauch a client from the executable in the "Clients" directory. All files are downloaded to that directory.
- make end_server : Terminate running clusters and master server. (Must be called in the same terminal as "make start_server")
- make clean : Delete the executables and clear the content of clusters.
- get 'filepath' : Download the file located at 'filepath' on the server.
- bye : Terminate the client.
- ls : List the content of the current directory of the server.
- pwd : Print the current working directory of the server.
- cd 'dirpath' : Change the current working directory to 'dirpath'.
- make
- make start_server
make client < tests/file.test
Available .test files:
- commands.test : Moves around the server using 'cd', print information using 'ls' and 'pwd'
- documents.test : Downloads all files (.pdf) from the directory Documents.
- pictures.test : Downloads all images from the directory Pictures.
- text.test : Downloads all text files (.java) from the directory Text.
./tests/concurrency.sh
Successful request
[size of file]
[file content]
End
Successful command
[command output]
- No such file
- Permission denied
- Unknown error
- Is a directory
- File must be in current working directory
- Empty command line
- Empty get request
- Unsupported option/argument
- Failed to change directory
- Unknown command
There are four clusters located within the "Clusters" directory:
- Nord
- East
- West
- South
They contain a copy of 'ftpserver' and identical files (after running "make"). They are assigned clients based on a rolling basis by the master server (executable located in the "Master" directory).
- Clients: Contains the executable 'ftpclient'. Clients created by "make client" download files to this directory.
- Clusters: Contains four clusters as mentionned above.
- Files: Contains the original files to be distribute to clusters as testing data.
- Master: Contains the executable 'ftpmaster' and a JSON file tracking the information of the four clusters.
- tests: Contains test file. Refer to the "Tests" section for usage.
- scirpts: Contains shell scripts used by the Makefile.
- cJSON: Helps with parsing JSON files.
- csapp: Wrapper for UNIX calls.
- utils: Contains utilities used by the main programs.
- ftpclient.c: A command-line based FTP client.
- ftpserver.c: Receives request from client(s) and send back appropriate responses.
- ftpmaster.c: A load balancer, distributes clients to clusters.