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 givencontent
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:
- The given
filename
does not exist in the personal file namespace of the caller.- Appending the file cannot succeed due to any other malicious action.
- Parameters
-
filename (string) - the name of the file
content ([]byte) - the data to be appended - Return
-
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.