clean ':' from filenames on macOS - #8168
Conversation
make ':' an invalid character for macOS clients
|
do you have a source for this? |
You're right - I have to correct myself - after a quick search, I can't find anything authoritative to back me up on that. macOS does prohibit using a colon in the filename, but apparently that isn't so much a file system restriction as it is a restrictions based on how macOS used to use the colon to separate directories eg bwright:Downloads:My Torrent.torrent. You can, however, find quite a few people online discussing how macOS doesn't allow you to use a colon in a filename, however. Can also do |
|
Perhaps What is libtorrent/src/torrent_info.cpp Line 96 in 163d364 |
\b is the backspace character. |
👍 Ya, googled it afterwards...... |
|
Ok. it seems like a reasonable change. The main thing I worry about with changing this filter is if someone has downloaded (and is seeding) a torrent with this filename in it. If that person upgrades it will no longer be seeding the file (but possible re-download it under the new name). But if it hasn't been possible to create these files on mac anyway, it shouldn't be a problem. |
|
the unit tests need to be updated |
fix unit test for macOS disliking colons
Co-authored-by: Arvid Norberg <arvid.norberg@gmail.com>
Correct. Note, however, that when you go look for the file in Finder, it will be named test/file.torrent. My understanding of this is that classic macOS used : as the folder separator, unix uses /, and OS X at release wanted to keep the capability of referencing paths using : in applications so finder translates : to /. |
Oh yes, I see now. Though it doesn't seems like |
|
I think this makes my concern much stronger. Anyone, on a Mac, seeding a torrent where a filename has a |
|
I think the issue can be summarized as follows: The only issue with colons in filenames is that Finder.app won't show them as colons. Therefore this PR would not make an otherwise unusable torrent usable. It would change a valid on-disk filename solely to work around how Finder displays it. |


libtorrent currently sanitizes ':' on Windows but not on macOS.
Since ':' is illegal on HFS+/APFS, this results in unusable filenames being passed to clients on macOS.
This patch adds ':' to invalid_chars for APPLE builds, consistent with Windows handling.