Skip to content
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

fix reading of partial clusters in fat32 #110

Merged
merged 1 commit into from
Apr 13, 2021
Merged

fix reading of partial clusters in fat32 #110

merged 1 commit into from
Apr 13, 2021

Conversation

deitch
Copy link
Collaborator

@deitch deitch commented Apr 12, 2021

Fixes #108

@deitch
Copy link
Collaborator Author

deitch commented Apr 12, 2021

@RafaelMarinheiro can you try the branch here and see if it resolves your issue #108? The tests pass now.

@RafaelMarinheiro
Copy link

Thanks! This fixes the issue with io.Copy, making it work as expected!

Having said that, the code with io.Copy is MUCH slower than the code with ReadAll and a single write. I guess this is happening because now you need to deal with FAT32 bookkeeping on every single Write call. You could have avoided this by postponing some of that bookkeeping to a Close() method in the file, but unfortunately the current API does not have anything like that in it.

Thanks again for the fix!

@RafaelMarinheiro
Copy link

This seems to have fixed #109 as well (at least now I can write a large number of things to the same directory and they show up afterwards). Could it be related in some way?

@deitch
Copy link
Collaborator Author

deitch commented Apr 13, 2021

Possibly. The Read was broken, which might have done it. Let's merge this in, then follow through on #109

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fat32.File does not not implement io.Writer correctly.
2 participants