I am trying to create file names that are longer than 260 charcters so that I can test some software. Does anyone know of a way to create a file name / folder combination that is greater than 260 characters?
Asked
Active
Viewed 7,043 times
1 Answers
1
For the most part pathnames don't have a limit defined, while the filename limit depends on the filesystem type:
FAT16 = 255 UTF-16
FAT32 = 255 UTF-16
NTFS = 255 UTF-16
ext3 = 255
ext4 = 256
Also, the filename limit may be reduced when under a deep hierarchy.
AFAIK you cannot overreach this limit, and this is why you have file metadata. And if Microsoft says that is their limit, then that's the breaks. I'm just glad we're not stuck with the 8.3 limit anymore. Which software on earth needs such long filenames anyway?
Added some tests cases
# path[100]\path[100]\file[60]
C:\0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789\ABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJ>echo "test" > 012345678901234567890123456789012345678901234567890123456789.txt
The system cannot find the path specified.
# too long!
# path[100]\path[100]\file[50]
C:\0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789\ABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJ>echo "test" > 01234567890123456789012345678901234567890123456789.txt
# file created
invert
- 4,996