Skip to content

imran91/CS733

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CS733

Versioned File Server

#Installation 1.Download a copy using: git clone https://github.com/imran91/CS733.git

2.Change directory to : cd $GOPATH/src/github.com/imran91/CS733/Assignment1

3.Run the test script using : go test

#Command Specification

  1. Write: create a file, or update the file’s contents if it already exists.
    write <filename> <numbytes> [<exptime>]\r\n
    <content bytes>\r\n

    The server responds with the following:
    OK <version>\r\n

  2. Read: Given a filename, retrieve the corresponding file:
    read <filename>\r\n

    The server responds with the following format (or one of the errors described later)
    CONTENTS <version> <numbytes> <exptime> \r\n
    <content bytes>\r\n

  3. Compare and swap. This replaces the old file contents with the new content provided the version is still the same.
    cas <filename> <version> <numbytes> [<exptime>]\r\n
    <content bytes>\r\n

    The server responds with the new version if successful
    OK <version>\r\n

  4. Delete file
    delete <filename>\r\n

    The server response (if successful)
    OK\r\n

#Errors

  1. ERR_VERSION <newversion>\r\n (the contents were not updated because of a version mismatch. The latest version is returned)
  2. ERR_FILE_NOT_FOUND\r\n (the filename doesn’t exist)
  3. ERR_CMD_ERR\r\n (the command is not formatted correctly)
  4. ERR_INTERNAL\r\n (remaining errors)

About

Cloud Assignment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages