Difference between revisions of "Portable Filenames"

From Gramps
Jump to: navigation, search
m (Needing clarification: formatting)
(empty page redirect to where mentioned)
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{languages|Portable_Filenames}}
+
#redirect [[Meaningful filenames]]
 
 
In order to be able to move our media files from one computer to another it is critical that the names of our files can be understood by the different file systems and encodings they meet.
 
 
 
To find a set of characters which can meet all these criteria this article is originally based on content from Wikipedia Online Encyclopedia, especially the articles [http://en.wikipedia.org/wiki/Filename Filenames], [http://en.wikipedia.org/wiki/Comparison_of_file_systems Comparison of file systems] and [http://en.wikipedia.org/wiki/Ascii ASCII character encoding] and [http://msdn.microsoft.com/en-us/library/aa365247.aspx Naming a File] from MSDN. Please add other references to improve this article.
 
 
 
= Recommendations =
 
If you follow the rules below your file will be handled without issues on all of the following: servers, USB drives, CD's, DVD's, Blue Ray discs, HD DVD's, hard drives formatted with FAT32, NTFS, EXT2/3, Windows from '95 onwards, POSIX compliant systems (Linux, Unix, OSX) and much more...
 
 
 
'''Use only the following characters'''
 
* a-z Lowercase alphabetical characters
 
* A-Z Uppercase alphabetical characters
 
* 0-9 Numerals
 
* - Hyphens (Dashes)
 
* _ Underscores
 
 
 
'''And only use them safely'''
 
* a-z,A-Z  Capital and small letters. Always use mixed case. ''MYFILE.txt'' can become ''myfile.txt'' without warning. ''MyFile.txt'' can not be changed without warning. (Windows [http://msdn.microsoft.com/en-us/library/aa365247.aspx ignores capitalisation])
 
* -        Hyphens must not start a file name.{{fact}}
 
 
 
'''There are limits to the maximum'''
 
* number of nested directories must not be more than eight (root plus seven) (limit of [http://en.wikipedia.org/wiki/ISO_9660 ISO 9660])
 
* number of directories to 65,535 (limit of [http://en.wikipedia.org/wiki/ISO_9660 ISO 9660]) on Windows)
 
* length of a file path to 256 characters (limit of [http://msdn.microsoft.com/en-us/library/aa365247.aspx Windows Path Size])
 
* length of a file name to 255 characters (limit of [http://msdn.microsoft.com/en-us/library/aa365247.aspx Windows Path Size])
 
* size of files to 4 GiB ([http://en.wikipedia.org/wiki/ISO_9660 limit of ISO 9660])
 
 
 
'''Some file names may not be used'''
 
*  CON, PRN, AUX, CLOCK$, NUL, COM0, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT0, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9 ([http://msdn.microsoft.com/en-us/library/aa365247.aspx ref]) also ., and .. ([http://en.wikipedia.org/wiki/Filename#Reserved_characters_and_words ref])
 
 
 
 
 
In Windows the space and the period are not allowed as the final character of a filename. The period is allowed as the first character, but certain Windows applications, such as Windows Explorer, forbid creating or renaming such files (despite this convention being used in Unix-like systems to describe hidden files and directories). Among workarounds are using different explorer applications or saving a file from an application with the desired name.
 
 
 
Some file systems on a given operating system (especially file systems originally implemented on other operating systems), and particular applications on that operating system, may apply further restrictions and interpretations. See comparison of file systems for more details on restrictions imposed by particular file systems.
 
 
 
In Unix-like systems, MS-DOS, and Windows, the file names "." and ".." have special meanings (current and parent directory respectively).
 
 
 
In addition, in Windows and DOS, some words might also be reserved and can not be used as filenames.<ref name="win"/> For example, DOS Device file:
 
CON, PRN, AUX, CLOCK$, NUL
 
COM0, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9
 
LPT0, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9.([http://msdn.microsoft.com/en-us/library/aa365247.aspx ref])
 
Operating systems that have these restrictions cause incompatibilities with some other filesystems. For example, Windows will fail to handle, or raise error reports for, these legal UNIX filenames: aux.c, q"uote"s.txt, or NUL.txt.
 
 
 
= Needing clarification =
 
The following are not recommended but I can't find any reference to why they could be a problem. They are all ASCII characters.
 
 
 
{| border="1"
 
|-
 
| #
 
| number sign
 
| {{yes}}
 
| Not reserved[http://en.wikipedia.org/wiki/Filename ref]
 
|-
 
| &
 
| Ampersand
 
| {{yes}}
 
| Not reserved([http://en.wikipedia.org/wiki/Filename ref])
 
|-
 
| '
 
| Apostrophe
 
| {{yes}}
 
| Not reserved([http://en.wikipedia.org/wiki/Filename ref]). Some websites have trouble handling file names containing apostrophes ([http://bugs.php.net/bug.php?id=33918 PHP Bug #33198])
 
|-
 
| ( and )
 
| Parentheses
 
| {{maybe}}
 
| Unclear. [http://en.wikipedia.org/wiki/(#Computing Reference].
 
|-
 
| +
 
| Plus
 
| {{yes}}
 
| Not reserved([http://en.wikipedia.org/wiki/Filename ref])
 
|-
 
| ,
 
| Comma
 
| {{yes}}
 
| Not reserved([http://en.wikipedia.org/wiki/Filename ref])
 
|-
 
| ;
 
| Semi colon
 
| {{yes}}
 
| Not reserved([http://en.wikipedia.org/wiki/Filename ref])
 
|-
 
| =
 
| Equals sign
 
| {{yes}}
 
| Not reserved. [http://en.wikipedia.org/wiki/Filename#Reserved_characters_and_words reference].
 
|-
 
| @
 
| At sign
 
| {{yes}}
 
| Not reserved. [http://en.wikipedia.org/wiki/Filename#Reserved_characters_and_words Reference].
 
|-
 
| [ and ]
 
| square brackets or box brackets
 
| {{yes}}
 
| Not reserved. [http://en.wikipedia.org/wiki/Filename#Reserved_characters_and_words Reference].
 
|-
 
| ^
 
| Caret
 
| {{yes}}
 
| Not reserved. [http://en.wikipedia.org/wiki/Filename#Reserved_characters_and_words Reference].
 
|-
 
| _
 
| Underscore
 
| {{yes}}
 
| Not reserved. [http://en.wikipedia.org/wiki/Filename#Reserved_characters_and_words Reference].
 
|-
 
| { and }
 
| Curly brackets
 
| {{yes}}
 
| Not reserved. [http://en.wikipedia.org/wiki/Filename#Reserved_characters_and_words Reference].
 
|-
 
| ~
 
| Tilde
 
| {{yes}}
 
| Not reserved. [http://en.wikipedia.org/wiki/Filename#Reserved_characters_and_words Reference].
 
|-
 
|}
 
 
 
= External links =
 
* [http://www.rideau-info.com/genealogy/digital/label.html Digital Cameras and Genealogy]
 
* [http://www.controlledvocabulary.com/imagedatabases/filenaming.html Filenames as a Strategy to Managing Your Image Assets] and [http://www.controlledvocabulary.com/imagedatabases/filename_limits.html Recommendations for Limitations on Image Filenaming] from the [http://www.controlledvocabulary.com/index.html Controlled Vocabulary website]
 
* [http://www.xaprb.com/blog/2005/11/17/maximizing-filesystem-portability/ How to make file names cross platform]
 
* [http://www.ordersomewherechaos.com/rosso/webdev/filenames/ Filenames: Which characters to use, Which characters to avoid]
 

Revision as of 02:33, 8 October 2011