-
Notifications
You must be signed in to change notification settings - Fork 76
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
Release/v0.6.0 #104
Release/v0.6.0 #104
Conversation
Also remove unused AcquireOpt option
Signed-off-by: Lachezar Lechev <[email protected]>
Signed-off-by: Lachezar Lechev <[email protected]>
Better reflects what it actually does.
Changed BlockSpi to AcquiredSdCard. Changed SdMmcSpi to SdCard.
Avoids errors like 'info! not defined', or 'info! defined twice'.
Now there is only "SdCard" in the public API. Any attempt to use the SD card when the card type is unknown will force a re-initialisation of the SD card. You no longer need to acquire.
Matches the name of the primary type contained within it.
Now we store an Option<CardType>, and the user can unsafely declare a certain type of card to be fitted and initialised.
Matches the num_blocks command in the BlockDevice API.
Stops it hanging if the card is missing.
1. Now we try and batch up card byte reads/writes into as few SPI transfer/write calls as possible. 2. The option is now "use_crc" and if not set, we don't even try and enable CRC mode. 3. Note that the 74 bits are not to enable SPI mode but to clear card internal state
Now you need blocking::spi::Write as well as blocking::spi::Transfer
Also add the code from the README into an example so we can at least check it compiles.
Puts the keys into alphabetical order.
Requires mutable access to the volume in order to do the write.
Gets you docs at the top level. Saves users a click. Also drops the deprecated Controller import. We need to do a breaking release anyway.
Now File and Directory are just integers, and they are joined by Volume. All the info is stored inside the volume manager. The upside is you no longer have to pass the right volume along with your file handle! It also becomes much easier to implement a Drop trait on File if you want (although we don't for the reasons explained in the comments). The downside is the File object no longer has any methods. The upside is that it's much easier to store files.
Now the tests unpack the gzipped disk automatically into RAM. Need to add some write tests and get the tarpaulin coverage figure up a bit higher.
Volume Manager API also now takes things that are "convertible to a short file name", so you can use a ShortFileName, or a &str.
Test coverage at 56.2%.
- Cluster is now ClusterId - Helper method for turning bytes to a block count - Removed unsafe open_dir_entry API
This is because some files have no starting cluster and thus look like the same file when they are not. Fixes #75
Co-authored-by: Ryan Summers <[email protected]>
Cleaning up some comments, and fixing the close file bug.
You can walk around a disk image and do directory listings. I had to make some more things 'Debug' so I could print the filesystem state. Also our handling of ".." was not right so I fixed that.
Fixes the build.
Also moved the code into a method so we can use ?. Although ? is a pain when your objects cannot safely be dropped.
Add a little shell example.
But this means I have always to close the file. Currently I store a RawFile object (as filehandler) and execute only the write. In this case the file gets created but stays always empty (Currently I don't close the file for testing, but in real scenario this can also happen, so the data is lost?) Usecase:
The problem is when I have to close it, the RawFile "handler" is invalid in my understanding. Is that correct? Reason why I don't like to close:
|
If closing/re-opening is a performance bottleneck, you could propose a PR containing a |
I thought about the same. I will have a look into it tomorrow and will create a pullrequest. Thanks for the project! |
Since DOS 7.1 the two most-significant bits of this cluster entry may hold two optional bitflags representing the current volume status on FAT16 and FAT32, but not on FAT12 volumes. These bitflags are not supported by all operating systems, but operating systems supporting this feature would set these bits on shutdown and clear the most significant bit on startup: Could this help? So the computer gets the indication that the filesystem was not properly closed and it should rescan? |
There is always a trade off between performance and reliability with FAT. I like the idea of being able to mark disks as dirty if they have open writable files, and non-dirty when the last writable file has been closed. I just wouldn't want to see read-only access (99% of my use case) mark the FS as dirty. |
Haha then we have opposite usecases 😄 i have most of the time writing. Neverthless, I will check this flag out. I don't think during read the dirty flag will be set |
Changed
Instead closing a file now flushes file metadata to the Directory Entry.
Requires mutable access to the Volume (#94).
SdCard::get_card_type
will now perform card initialisation (#87 and #90).Cluster
toClusterId
and stopped you adding two togetherAdded
append_file
,create_file
,delete_file
,list_dir
,shell
tests/directories.rs
,tests/read_file.rs
Removed
Controller
alias forVolumeManager
removed.VolumeManager::open_dir_entry
removed, as it was unsafe to the user to randomly pick a starting cluster.create_test
,test_mount
,write_test
,delete_test