-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
Add support for writing long file name to FAT #18
Add support for writing long file name to FAT #18
Conversation
Another aspect are short name collisions, while they should be correctly handled at the |
One nice finding discovery that I was able to implement is from http://tomgalvin.uk/blog/gen/2015/06/09/filenames/ where he gives details about how short name hashing for handling collisions is actually implemented in Windows NT+ So the |
Also, the full validation of this PR will require to check that generated FAT disk do work when mounting them on Linux or from a USB stick. |
There is really no need for such reverse engineering. Windows NT FAT driver is open source since at least 20 years. The logic for short names is mostly here: |
Not really π The function used to generate 8.3 name is behind the function |
Ah, I misunderstood what the reverse engineering was about then! Sorry! |
So, I have added several tests, it should have improved coverage on FAT from 70% to 77%. It is far from perfect, the original project is still missing some stuffs here and there, but it's getting better with these tests hopefully. π€ I made the PR ready for review to give it more visibility. Tomorrow early morning I will spend some time to verify that produced FAT filesystem with LFN are working well when mounted from a real disk. |
I just did some experiments with your code. It looks good, I think. I tried to remove your |
I was able to test it on a real disk and seems to work just fine, so this should be good to go! |
Really nice! Thanks a lot for your contribution! π |
Looks like tests fail on Linux. Maybe there is a hard coded |
Everything fixed, merged and new NuGet packages are right now uploading. Again, thanks a lot for your contributions! |
Fixes #15
Opening this PR early on as a draft version with a first version for adding full support for long file names (LFN). It should not be merged yet! π
The tests are passing β , but I will have to add a lot more tests and there are plenty of corner cases that will/might not work yet as expected (e.g changing a short name)
The main change is
FileName
class converted to aFatFileName
struct. This new struct covers the encoding/decoding of LFN+SFN.Another - smaller - change is in Directory for using more acceleration dictionaries + a free entry acceleration table (in order to handle LFN entries being deleted).
It's gonna take a few more days to polish and make it solid. π€