Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

A simple client-server network file system (NFS) over a simulated disk.

Notifications You must be signed in to change notification settings

dmonaldo/simple-network-file-system

Repository files navigation

simple-network-file-system

A simple client-server network file system (NFS) over a simulated disk.

The file system is built on top of a virtual disk that is simulated using a file. In this virtual disk, there are 1,024 disk blocks (numbered from 0 to 1023) and each block is 128 bytes. The server is not a multi-client program.

Structure:
  • Client-Side Shell (Shell.cpp): Processes the network file system commands from the command line.
  • Server-Side File System (FileSys.cpp): Provides an interface for NFS commands received from the client via the TCP socket and sends back the responses to the client via the TCP socket.
  • Basic File System (BasicFileSys.cpp): A low-level interface that interacts with the disk.
  • Disk (Disk.cpp): Represents a "virtual" disk that is contained within a file.
  • Client (client.cpp): NFS client main program.
  • Server (server.cpp): NFS server main program.
File System Commands:
  • mkdir <directory> - Creates an empty subdirectory in the current directory.
  • ls - List the contents of the current directory. Directories should have a '/' suffix such as 'myDir/'. Files do not have a suffix.
  • cd <directory> - Change to specified directory. The directory must be a subdirectory in the current directory. No paths or ".." are allowed.
  • home - Switch to the home directory.
  • rmdir <directory> - Removes a subdirectory. The subdirectory must be empty.
  • create <filename> - Creates an empty file of the filename in the current directory. An empty file consists of an inode and no data blocks.
  • append <filename> <data> - Appends the data to the file. Data should be appended in a manner to first fill the last data block as much as possible and then allocating new block(s) ONLY if more space is needed. More information about the format of data files is described later.
  • stat <name> - Displays stats for the given file or directory. The precise format is described later in the document.
  • cat <filename> - Display the contents of the file to the screen. Print a newline when completed.
  • head <filename> <n> - Display the first N bytes of the file to the screen. Print a newline when completed. (If N >= file size, print the whole file just as with the cat command.)
  • rm <filename> - Remove a file from the directory, reclaim all of its blocks including its inode. Cannot remove directories.
Team Members:

Alex Runciman (@agrsu)

  • Sole creator of FileSys.cpp: mkdir, rmdir, ls, rm
  • Partial creator for server.cpp, in Shell.cpp: rpc_mkdir, rpc_rmdir, rpc_rm, rpc_ls
  • Design help with FileSys.cpp: create, home, stat

Dante Monaldo (@dmonaldo)

  • Created server.cpp and established connections between client and server
  • Mounted NFS to run commands from client
  • Parsed and displayed responses to client

Jackie Wong (@jmhw)

  • In FileSys.cpp, wrote create, home, stat
  • In Shell.cpp, wrote create_rpc, home_rpc, stat_rpc

Matt Harrison (@WarpFactors) -

  • Sole creator of following FileSys.cpp methods: cd, cat, head, is_directory
  • Sole creator of following Shell.cpp methods, cd_rpc, cat_rpc, head_rpc
  • Helped design the following in FileSys.cpp: append
Functionality Rating
  • Rating: A-
  • Explanation: This program implemented all of the functions except for append. The core functionality of the server and client works well.
Test Cases:
  • Test case #1: mkdir abc

  • Results:

  • Test case #2: cd abc

  • Results:

  • Test case #3: create duck

  • Results:

  • Test case #4: home

  • Results:

  • Test case #5: ls

  • Results: abc/ duck

  • Test case #6: cd abc

  • Results:

  • Test case #7: cat duck

  • Results:

  • Test case #8: rmdir abc

  • Results:

  • Test case #9: stat duck

  • Results:

  • Test case #10: head duck (nbytes)

  • Results:

  • Test case #11: cat duck

  • Results:

  • Test case #12: append (something)

  • Results:

  • Test case #13: rm duck

  • Results:

  • Test case #14: home

  • Results:

  • Test case #15: ls

  • Results:

  • Test case #16: rmdir abc

  • Results:

About

A simple client-server network file system (NFS) over a simulated disk.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •