0

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?

3
  • 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. Mar 25, 2011 at 10:57
  • Yes but how do you create a file greater than 260?
    – Nick
    Mar 25, 2011 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. Mar 25, 2011 at 16:08

1 Answer 1

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
6
  • plm software for example en.wikipedia.org/wiki/Product_lifecycle_management. its pretty easy to get filenames which are HUGE.
    – akira
    Mar 25, 2011 at 8: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, 2011 at 8:32
  • no, software where you can download files from the proper database backend into your filesystem.
    – akira
    Mar 25, 2011 at 10:51
  • It is possoble to have file/foldernames greater than 255. This question superuser.com/questions/78434/… is evidence. I just do not know how to create them
    – Nick
    Mar 25, 2011 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) Jun 22, 2019 at 21:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .