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

[WIP] Truncate on character boundaries #1533

Closed
wants to merge 1 commit into from

Conversation

untitaker
Copy link
Contributor

Fix #1418

@untitaker untitaker changed the title Truncate on character boundaries [WIP] Truncate on character boundaries Jul 3, 2015
@untitaker
Copy link
Contributor Author

Alright, I think we have another problem with this:

So I think truncate_path shouldn't actually expose a length parameter and just do the right thing on each platform. This makes for a less confusing API IMO.

@sampsyo
Copy link
Member

sampsyo commented Aug 9, 2015

Interesting. To refine this a little bit:

  • The component length limit on Unix is filesystem-dependent, and reported by statvfs. (See beets.util.max_filename_length.)
  • On Windows, we use the magical \\?\ prefix to get long filenames. This gives us ("approximately") 32,767 characters for the total length, according to the reference. The component is still limited separately, to "commonly" 255 characters.

@sampsyo
Copy link
Member

sampsyo commented Aug 9, 2015

The upshot is that both platforms have component length limits. You're right, though, that the Windows limit is in characters.

@jtpavlock
Copy link
Contributor

closing as abandoned

@jtpavlock jtpavlock closed this Jul 10, 2020
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.

max_filename_length creates invalid unicode characters
3 participants