-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This pull request brings back FAT file system support along with multiple improvements #212
Merged
Conversation
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
Bytes_Total feels like it holds the size of the file, as in "total bytes of the file" but in really it's the current index in the file. And the comment associated with this field already says that it's an index: "The actual file index". Offset of File_Offset are other possible names for this field.
Otherwise an incorrect value is returned to the caller.
as opposed to handles. And pass handles as out parameters. File and directory handles will always be used for more than one operation. Read/Write and Close at least, so it will require to declare a variable for them. Handle : Any_File_Handle; begin Open ("/my_file". Handle); Handle.Read (...) Handle.Close; vs -- This is not practical because now I can't close the handle Open ("/my_file").Read (...); On the other side, one might want to just check the status code of a function without declaring a variable to do so. if Open ("/my_file", Handle) /= OK then ... vs Handle : Any_File_Handle; Status : Status_Code; begin Handle := Open ("/my_file", Status); if Status /= OK then ...
And update the native implementation.
in a package called File_IO. This hides some of the complexity of dealing with access to handle and answers some of the questions discussed in the issue #68. The package also provides the mounting interface, taken from Filesystem.VFS.
Some of the virtual filesystem are obsolete because of missing features in the new implementation.
Fabien-Chouteau
force-pushed
the
bring_back_fat_support
branch
from
September 15, 2017 16:49
3251327
to
555d8e8
Compare
This function is expected to use Parent.Current_Index as opposed to a local index, as stated in the comments of this function and the calling function.
pat-rogers
approved these changes
Oct 2, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The first patches merge the FAT support with the existing interface and file systems (native and semihosting) and add two tests for FAT using a disk image.
The second part creates a "front-end" interface to read/write files. We realized in the past that it's difficult to have a good file-system driver interface (HAL.Filesystem) that would also be user friendly, in particular with regards to the handling of handles and their deallocation (#68). The front-end interface is somewhat similar to Ada.Text_IO or GNAT.OS_Lib except that standard Ada.Text_IO* rely a lot on exception which are not always available or desirable in our case.
There's also the beginning of a documentation.