In this client-server project, a client can request a file or a set of files from the server. The
server searches for the file/s in its file directory rooted at its ~ and returns the file/files
requested to the client (or an appropriate message otherwise). Multiple clients can connect
to the serverw from different machines and can request file/s as per the commands listed below.
The server, mirror1 and mirror2 and the client processes run on different
machines/terminals and communicate using sockets only. We also alternate between the serverw24, mirror1 and mirror2 at an interval of every 3 new connections.
List of Client Commands:
◦ dirlist -a:
the serverw24 must return the list of subdirectories/folders(only) under its
home directory in the alphabetical order and the client must print the same
ex: clientw24$ dirlist -a
◦ dirlist -t:
the serverw24 must return the list of subdirectories/folders(only) under its
home directories in the order in which they were created (with the oldest created
directory listed first) and the client must print the same
ex: clientw24$ dirlist -t
◦ w24fn filename
If the file filename is found in its file directory tree rooted at ~, the serverw24
must return the filename, size(in bytes), date created and file permissions to
the client and the client prints the received information on its terminal.
◦ w24fz size1 size2
The serverw24 must return to the client temp.tar.gz that contains all the files
in the directory tree rooted at its ~ whose file-size in bytes is >=size1 and
<=size2.
size1 < = size2 (size1>= 0 and size2>=0)
◦ w24ft
the serverw24 must return temp.tar.gz that contains all the files in its directory
tree rooted at ~ belonging to the file type/s listed in the extension list, else the
serverw24 sends the message “No file found” to the client (which is printed on
the client terminal by the client)
◦ w24fdb date
The serverw24 must return to the client temp.tar.gz that contains all the files
in the directory tree rooted at ~ whose date of creation is <=date
◦ w24fda date
The serverw24 must return to the client temp.tar.gz that contains all the files
in the directory tree rooted at ~ whose date of creation is >=date
Technologies Used:
◦ C
◦ Socket Programming, pipes, forks, system calls, library functions