1126
General Software Discussion / Re: File Names : what should be avoided
« Last post by Eóin on June 09, 2007, 07:20 PM »Het Armando, this link is worth glancing through. It is referring to working with highly portable paths so is actually quite a limited subset of what, say, Windows supports. Then it is probably not a bad idea to develop good portable habits should you switch OS at some later stage. I know I haven't been following these guidelines, but think I will try and start from here on
. I'll repeat the recommendations below but the link also gives the rational behind them.

- Limit file and directory names to the characters A-Z, a-z, 0-9, period, hyphen, and underscore.
- Do not use a period or hyphen as the first character of a name. Do not use period as the last character of a name.
- Do not use periods in directory names.
- Do not use more that one period in a file name, and limit the portion after the period to three characters.
- Do not assume names are case sensitive. For example, do not expected a directory to be able to hold separate elements named "Foo" and "foo".
- Do not assume names are case insensitive. For example, do not expect a file created with the name of "Foo" to be opened successfully with the name of "foo".
- Don't use hyphens in names.
- Limit the length of the string returned by path::string() to 255 characters. Note that ISO 9660 has an explicit directory tree depth limit of 8, although this depth limit is removed by the Juliet extensions.
- Limit the length of any one name in a path. Pick the specific limit according to the operating systems and or file systems you wish portability to:
- Not a concern:: POSIX, Windows, MAC OS X.
- 31 characters: Classic Mac OS
- 8 characters + period + 3 characters: ISO 9660 level 1
- 32 characters: ISO 9660 level 2 and 3
- 128 characters (64 if Unicode): ISO 9660 with Juliet extensions