Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

11
  • 24
    This answer is not entirely correct. The max size of a filename is 255 Bytes or C/C++ char types. But the max characters in a filename vary. When using UTF-8 which is the default for most systems, the filename can be between 63-255 characters (aka Code Points), if using UTF-16, 63-127. Its important to note, that 1 character can be one or more bytes in storage space and depends on the code set that the user of the system is using. Commented May 30, 2016 at 19:31
  • 2
    Suggestion to developer: Split encrypted names across subdirectories that are hidden from the end user to get the necessary length, potentially even exceeding the linux max name length limit if an external filesystem needs it. A single file or directory becomes "ENCRYPTFS-01-OF-04[.....]/ENCRYPTFS-02-OF-04[.....]/ENCRYPTFS-03-OF-04[.....]/ENCRYPTFS-04-OF-04[.....]" -- Linux btrfs, ext1-4, and others have no max defined directory depth so the filesystem can handle expanding file and dir names across multiple unexposed subdirectories like this. Commented Dec 9, 2016 at 23:52
  • 2
    My suggestion would have been to store whatever metadata you're storing in the xattrs, instead of in the filename. :| Commented Sep 14, 2018 at 1:07
  • 1
    You say eCryptfs "can optionally encrypt (obscure) filenames (or not)." How do I disable file name encryption so I can get my full 255-char file names back instead of being limited to 143 chars? I believe the way I got eCryptfs installed, by the way, was by checking the box or whatever for "Encrypted home directory" during my Ubuntu install process. Commented Jun 13, 2019 at 7:08
  • 1
    and a maximum path of 4096 characters is incorrect. PATH_MAX is just the maximum length for certain libc functions which can be worked around. There is no hard limit. Commented Sep 1, 2019 at 9:51