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

Add LFN support when iterating directories #157

Merged
merged 9 commits into from
Oct 29, 2024
Merged

Conversation

jonathanpallant
Copy link
Collaborator

You can now optionally see the long file names when doing directory listings. To do so you must pass an LfnBuffer of your chosen size to the new iterate_dir_lfn methods.

Long File Names carry this checksum of their matching Short File Name.
Used to buffer Long File Names. Designed to be fed 16-bit UCS-2 chunks in reverse, like you find in a directory.
Scoops up bits of LFN into the given LFN buffer and if it all looks OK, passes it to the user-supplied closure as a &str.
@jonathanpallant jonathanpallant mentioned this pull request Oct 25, 2024
5 tasks
@thejpster
Copy link
Member

ugh, dealing with the fact that one unicode character might become two UTF-16 code units, and those two code units could be split across two directory entries, was a nightmare. But I think this works.

Copy link
Member

@eldruin eldruin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks!
Could you add an entry to the changelog about this?

@thejpster
Copy link
Member

Looks good to me, thanks! Could you add an entry to the changelog about this?

Done

Copy link
Member

@eldruin eldruin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your work!

@eldruin eldruin added this pull request to the merge queue Oct 29, 2024
Merged via the queue into develop with commit 52e0e4f Oct 29, 2024
8 checks passed
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.

3 participants