Skip to main content Link Search Menu Expand Document (external link)

5.5 User.AppendToFile

AppendToFile(filename string, content []byte) (err error)

Given a filename in the personal namespace of the caller, this function appends the given content to the end of the corresponding file.

The client MUST allow content to be any arbitrary sequence of bytes, including the empty sequence.

Note that, in the case of sharing files, the corresponding file may or may not be owned by the caller.

You are not required to check the integrity of the existing file before appending the new content (integrity verification is allowed, but not required).

Returns an error if:

  1. The given filename does not exist in the personal file namespace of the caller.
  2. Appending the file cannot succeed due to any other malicious action.


filename (string) - the name of the file
content ([]byte) - the data to be appended


err (error)

Do not forget that your design must satisfy all requirements, including:
  • The implementation of this method must satisfy the append efficiency requirement.
  • Users can have multiple active user sessions at once.