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

Filename length #152

Open
brokkr opened this issue Jul 4, 2021 · 0 comments
Open

Filename length #152

brokkr opened this issue Jul 4, 2021 · 0 comments
Milestone

Comments

@brokkr
Copy link
Owner

brokkr commented Jul 4, 2021

We're only indirectly enforcing filename length restrictions, i.e. by eventually dropping down to the 20 bytes fallback name.

Filesystems vary in what is permissible filename lengths. From ReiserFS' almost 4k length, over HFS/NTFS' 255 UTF-16 characters, to 255 bytes on the ext* filesystems.

Solution 1: Integrated into current system

Attach the length restrictions to the current character restriction sets. So permissive is really ext* (i.e. 255 bytes). ntfs gets a 255 character limit, restricted goes back to 255 bytes and fallback is fallback.

It is at best an approximation as you might wish to use ntfs restrictions on names (because of samba) but also have the 255 byte limit enforced

Solution 2: One limit for all

Enforce 255 bytes limit universally. Upside: Simple to enforce. Downside: It could reduce NTFS names to less than 64 characters.

Solution 3: Trial and error

The names dictionary returns tuples instead of strings: one 255 character limited string, one 255 byte limited.
At time fo download do a second attempt using the second version.

@brokkr brokkr added this to the 2.0 milestone Jul 4, 2021
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

No branches or pull requests

1 participant