Цитата: adolfus от 12.08.2019 16:05:09А теперь эксперимент. У Вас есть под рукой виндовс с разделом NTFS? Создайте в каком-нибудь каталоге файлы с именами (валидными в контексте Std. IEEE 1003.1):
"...", " ..", ".. "или " ".
":::"
"\\\"
"c:\windows\system32\cmd.exe"
"c:\windows\system32\cmd.exe "
"c:\windows\system32\cmd.exe "
Расскажите нам о результатах.
У меня на POSIX-совместимой системе они такие:
Вы путаете ФС и ОС. Ограничения эти от ОС. Сама ФС может иметь несколько атрибутов имен, в т.ч. и POSIX-совместимый. А то так я тож могу "эксперимент" выктатить, где из под WSL'а покажу вам нативный, соответствующий стандарту вывод df, который слушается ту самую переменную. Но это ничего не скажет о ФС.
Доку по нтфс'у я нахрапом не нашел, но педивикия таки клевещит от че:
Paths can be up to 32,000 characters.
Forbids the use of characters in range 1-31 (0x01-0x1F) and characters " * / : < > ? \ |
unless the name is flagged as being in the Posix namespace. NTFS allows each path component (directory or filename) to be 255 characters long
[dubious – discuss].
Windows forbids the use of the MS-DOS device names AUX, CLOCK$, COM1, …, COM9, CON, LPT1, …, LPT9, NUL and PRN, as well as these names with any extension (for example, AUX.txt), except when using Long UNC paths (ex. \\.\C:\nul.txt or \\?\D:\aux\con). (CLOCK$ may be used, if an extension is provided.) The Win32 API strips trailing space and period (full-stop) characters from filenames, except when UNC paths are used.
These restrictions only apply to Windows; in Linux distributions that support NTFS, filenames are written using NTFS's Posix namespace, which allows any Unicode character except / and NULL