Filesystem Guidelines

File and folder names should comply with the regular expression\.?[a-zA-Z0-9]*([\-][a-zA-Z0-9]+)*([\.][a-zA-Z0-9]+)*. A path complying with this grammar may look like this:/home/splitcells/Documents/.links-to-nothing.txt. Before that, underscore instead of hyphen/dashes were considered, because this way, non-hidden files, without their respective file suffixes are also legal variable names in most programming languages and shells. Therefore, this format should be very portable, by avoiding symbols with special meaning. However, hyphens are much more preferred by search engines and are also used in Linux package names . The use of hyphens makes it possible to have complex file names and may also represent a path for themselves. Also, a file name should not be longer than 255 characters.

Assume and use case sensitivity, but do not rely on the fact, that 2 files with the same case insensitive content but different case sensitive content can be stored in the same folder. Prefer using only lower case file names, in order to avoid this problem.

Even though, folders suffixes like file suffixes are not common, it is of no use to allow different sub name separators for files and folders. Therefore, it is not allowed to use dots (.) instead of hyphen symbols (-) in folder names.

File and folder names starting with a digit are allowed, as otherwise paths for archive like things can get overly complicated. Seeblog/2022/11/12/article.xmlorblog/2022-11-12-article.xml, where using a non digit prefix would not lead to any improvements. Also, keep in mind, that file names cannot be assumed to be always translate able to variable names in programming languages, because of special symbols like dots.or hyphens-. Therefore, leading digit in names do not worsen this situation.

In this chapter file and folder names are used interchangeably.

There is no global standard for supported path and file name lengths. Windows may support only up to 260 characters for paths, but sometimes seems to support up to about 32,767 characters.   The filesystem ext4 does only seem to support file name lengths of up to 255 bytes. , whereas there seems to be no path length limit present.   Encrypted drives on Synology have no limits on their path length, but the file and folder names seem to be limited to about 143 characters. In other words, the support for long paths and file names varies greatly, and therefore overly long path and file names must be avoided.

In order to maximise compatibility, the file name and path length should be greatly limited. Especially, because adjusting paths on mass, when finding a problem, may be a great problem.

File names should be no longer than 80 symbols and have to be shorter than 100 symbols. Path names have to be shorter than 250 symbols, in order to have a some left over space for a parent folder. Path length limits apply to the relative path, starting form the affected repo's root folder. A repo might be a git repository, a folder that is synchronized over the network or something else. Absolute path length are not concerned here, as this is a hard to control variable.