Enforce write-once property #1

Closed
jadeallenx wants to merge 20 commits from mra/write-once into master
jadeallenx commented 2015-08-05 20:01:50 +00:00 (Migrated from github.com)

This PR implements write-once enforcement. It does this by reading 1 byte at the supplied offset and testing that it gets eof from the Erlang run-time. Other values are treated as errors: if bytes are returned from the read attempt, we respond with an {error, error_written} tuple. Other errors would come from the POSIX file handling layer and are passed through unchanged.

This PR implements write-once enforcement. It does this by reading 1 byte at the supplied offset and testing that it gets `eof` from the Erlang run-time. Other values are treated as errors: if bytes are returned from the read attempt, we respond with an `{error, error_written}` tuple. Other errors would come from the POSIX file handling layer and are passed through unchanged.
jadeallenx commented 2015-08-06 03:58:10 +00:00 (Migrated from github.com)

TODO:
[] Build a manager process which serializes reads/writes/appends to a given prefix and tracks the state of written/not written on a byte level basis.

TODO: [] Build a manager process which serializes reads/writes/appends to a given prefix and tracks the state of written/not written on a byte level basis.
jadeallenx commented 2015-10-06 03:27:16 +00:00 (Migrated from github.com)

Closing in favor of #6

Closing in favor of #6

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: greg/machi#1
No description provided.