0

Why are current filesystems limited to 255 characters limit for filenames even though hardware have improved drastically over the last few decades ?

Why are we limited to 255 characters filenames even though we are in the Ghz era ?

2
  • The limitations on a file name have nothing to do with the processor
    – Ramhound
    Commented Oct 11, 2016 at 11:40
  • AT Ramhound. He said "Era" Like saying Why are we still driving cars when we are in the era of airplanes. He's talking about the general state of how advanced things are in one sense but not in another.
    – barlop
    Commented Apr 29, 2020 at 8:20

2 Answers 2

3

Mostly because file names are stored in the file system, where there is a single byte dedicated to their length. Changing this to two bytes is theoretically possible, but creates a new and incompatible file system. That's just not worth it.

Mind you, Windows historically had a 255 path length. That was considered too strict and has been progressively relaxed (in the sense that it has become easier for a program to bypass)

4
  • 1
    be interesting if you add why in DOS was it 8.3? 'cos it wouldn't have been less than one byte presumably.
    – barlop
    Commented Oct 11, 2016 at 10:26
  • 1
    @barlop: Easy: DOS didn't even bother storing the file name lengths. All names were stored as 11 characters, FAT doesn't even store the .. Remember, the 8.3 format dates back to the original, most primitive IBM PC.
    – MSalters
    Commented Oct 11, 2016 at 10:32
  • 1
    Interesting. DOS aside... I guess it'd have been worth them using a termination character to mark the end of a filename(then they could go longer), though I don't know - perhaps a byte storing the length is marginally more efficient. Is the 1 byte you mention, something that limits the path to 255? Or are they separate?(like the 1 byte limits the filename and something else limits the path), 'cos a path limit like that can be a bit annoying, but a filename that long isn't that necessary. (And granted the path limit is possible to bypass).
    – barlop
    Commented Oct 11, 2016 at 11:03
  • 1
    @barlop: A typical file system doesn't care about path lengths. E.g. /mnt/home/foo/bar.txt may be the full path, but the file system itself only contains a foo directory and a bar.txt file. The /mnt/home part is where the OS mounts the file system. The whole path is created by dynamically concatenating these parts, inside your running program.
    – MSalters
    Commented Oct 11, 2016 at 11:08
0

There is very little value in allowing more chars, so none of the newer file system cared to implement it - it would have relevant size and performance cost.

Typically, any requirements for longer filenames are from improper design, and can be redirected to databases, or the content of the file.

1
  • "None of the newer filesystems" is incorrect, Reiser uses 4K. But that was a new incompatible format anyway.
    – MSalters
    Commented Oct 11, 2016 at 11:04

You must log in to answer this question.

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