Open ghost opened 8 years ago
As a side note, from http://linux.die.net/man/8/mount.ntfs-3g:
windows_names
This option prevents files, directories and extended attributes to be created with a
name not allowed by windows, either because it contains some not allowed character
(which are the nine characters " * / : < > ? \ | and those whose code is less than 0x20)
or because the last character is a space or a dot. Existing such files can still be read
(and renamed).
Oh sanitize_open
already implements logics for generating valid Windows paths. However, detecting windows_names
is not practical as there are other NTFS implementations. An option like --use-windows-path
may a good idea. This option can be useful for those who share files between NTFS and non-NTFS filesystems, too.
Before submitting an issue make sure you have:
What is the purpose of your issue?
Log output
Description of the issue
NTFS partitions mounted with the
windows_names
option disallows files and directories from containing<>:"/\|?*
and from ending with a.
. I believe the former is taken care of by youtube-dl, but the latter is not. Python will throw aERROR: unable to create directory [Errno 22] Invalid argument
exception when you try to create a directory ending with a.
.In my example, I try to download a playlist named
Singles/Misc.
with the output template%(uploader)s/%(playlist)s/%(playlist_index)s. %(title)s-%(id)s.%(ext)s
. If the playlist's name, and I presume the uploader's name, ends with.
the exception will be thrown.Example
/etc/fstab
for mounting an NTFS partition with thewindows_names
option:Suggested solution
I see three main alternatives, although if any of you find a more creative solution then please let me know:
windows_names
option and follow Windows filename compatibility if that is the case.--restrict-filenames
option also replace dots from the end of directory names and filenames.NOTE: Any solution would need to replace an arbitrary amount of dots from the end of the file and directory names, as their names could contain multiple dots:
playlist name...