-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Seeking before beginning of file should fail
When seeking in a file to a location before the beginning of the file, the operation seems to succeed. While if i try to do the same with a "real" file then the seek command will return an error. So i changed the seek method to return false if the offset is less than 0. This seems to solve my problem and behaves in the same way as seeking in a real file. However I do not know if there are situations where seeking before the beginning of the file could be a valid use case. testing with fseek on unix fs always returns -1 when seeking past the beginning of the file. Added five test assertions to validate this behavior.
- Loading branch information
Showing
2 changed files
with
15 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters