Course:CPSC312-2021/FTPServer

From UBC Wiki

FTPServer

Authors: Sadek Elbetar, Matthew Ng, Victor Zhu

What is the problem?

Sometimes we want to retrieve files from a remote machine that we own, but how can we achieve this? We can use an ftp client to retrieve data from an ftp server, but what if we don't have an ftp server running on our remote machine?

Our project solves this issue by building a minimal ftp server that can retrieve files. We will follow the specification in (RFC959) to build the ftp server.

What is the something extra?

The ftp server will support specifying the starting directory and access permissions for each user. These permissions will specify what actions a user is allowed to take.

The following permissions will be supported:

Read permissions:

"e" = change directory (CWD, CDUP commands)

"l" = list files (NLST command)

"r" = retrieve file from the server (RETR command)

What did we learn from doing this?

1. We learned how to setup projects in Haskell that is ready to compile by using cabal and defining cradles.

2. We gained experience in network programming in Haskell and the libraries it provides. Socket programming in Haskell turned out to be a pleasant experience. For example, there is a function that won't return until all data is sent or an error occurs, so the programmer doesn't need to do a manual check to ensure that all data has been sent.

3. We learned how to control exceptions and perform error handling using catch blocks.

4. We learned how to retrieve command line arguments passed to the program when you execute it. We also learned how to validate that the provided arguments is in the correct format.

Links to code etc

https://github.com/selbetar/FTPServer/