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 5,867 times
0
-
You can have a folder/name path greater then 260 characters AFAIK, but some software doesn't play nicely. File names have a hard limit of 255 characters (due to most filesystems), so there's nothing you can do about that. – Breakthrough Mar 25 '11 at 10:57
-
Yes but how do you create a file greater than 260? – Nick Mar 25 '11 at 15:41
-
the long and short answers yield the same conclusion - you can't. If you are hitting this limit, then you *are* doing something wrong and need to consider an alternative data storage method. – Breakthrough Mar 25 '11 at 16:08
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
- 2
- 22
- 32
-
plm software for example http://en.wikipedia.org/wiki/Product_lifecycle_management. its pretty easy to get filenames which are HUGE. – akira Mar 25 '11 at 08:15
-
So you mean systems that don't use proper database back-ends. Ah okay then. In that case the PLM software in question should address this as a technical support issue - not much one can do RE file system limits I'm afraid. – invert Mar 25 '11 at 08:32
-
no, software where you can download files from the proper database backend into your filesystem. – akira Mar 25 '11 at 10:51
-
It is possoble to have file/foldernames greater than 255. This question http://superuser.com/questions/78434/tool-for-deleting-directories-with-path-names-too-long-for-normal-delete is evidence. I just do not know how to create them – Nick Mar 25 '11 at 15:43
-
@Nick The individual path components must be up to 255. The full path may be up to 65534 Unicode characters on Windows and unlimited on Linux (though you cannot directly access paths longer than 4096 characters on Linux -- you need to use relative paths) – Paul Stelian Jun 22 '19 at 21:08
-
This was question was asked so long ago but I think the issue I was having was trying to figure out how to set create a file name that long – Nick Jun 22 '19 at 21:43