Cross-platform file sharing is very commonplace nowadays. This article will explain the limitations posed by Windows and Mac when it comes to naming your files and folders. It will outline which characters to avoid when you name your files or folders to ensure maximum cross-platform compatibility when you move files between Windows and Mac.
Windows File Naming Convention
The Windows operating system can use two different file systems:
- Protected-Mode File Allocation Table (FAT) file system
- New Technology File System (NTFS)
The two systems have much in common, but the characters permitted in a file or folder name may differ. In the conventions listed below, it is true for both systems unless otherwise specified. Specifically there are cases where NTFS does not have the limitations (see note below).
On Windows running the NTFS file system
- do not use any of the following characters when naming your files or folders:
- / ? < > \ : * | ” and any character you can type with the Ctrl key
- file and folder names may be up to 256 characters long
- the maximum length of a full path is 260 characters
On Windows running the FAT file system
- do not use the caret ^ in your files or folder names, in addition to:
- / ? < > \ : * | ” and any character you can type with the Ctrl key
- file and folder names may be up to 255 characters long
- the maximum length of a full path is 260 characters
In addition to illegal characters, the following conventions are also illegal:
- Placing a space at the end of the name
- Placing a period at the end of the name
The following names are reserved under Windows (i.e. Do not use as your file or folder names):
- com1, com2, com3, com4, com5, com6, com7, com8, com9, lpt1, lpt2, lpt3, lpt4, lpt5, lpt6, lpt7, lpt8, lpt9, con, nul, prn
Note:
The previous conventions are true only if the application used in managing them is does not use the Unicode API. Although the file system may support most of the above mentioned conventions the operating system may not. For example, the NTFS file system allow paths to have a length up to 32,767 characters with each component (folder, file, etc.) being limited to 255 characters. However some windows applications like Windows Explorer, for example, may not behave correctly in this circumstance.
Below the Macintosh conventions will touch the fact that the colon “:” is an invalid character in the Macintosh Operating Systems. Under Windows and the NTFS file system the colon is an illegal character, because it is used to open alternate file streams. However all other characters can be moved on and off the NTFS file system if a program with Unicode support is used.
Mac OS 9 File Naming Convention
- The only illegal character for file and folder names in Mac OS 9 is the colon “:”
- File and folder names may be up to 31 characters in length
Mac OS X File Naming Convention
Since Mac OS X is build on top of UNIX there are a few inherent conventions that OS 9 users may not expect. Because of this, migrating certain files and folders from OS 9 to OS X may cause unexpected behavior.
- The only illegal character for file and folder names in Mac OS X is the colon “:”
- File and folder names are not permitted to begin with a dot “.”
- File and folder names may be up to 255 characters in length
Examples of Unexpected Behavior
Below are a few scenarios that show what can happen if file names that are acceptable on one operating system are moved to another:
Example 1
- Create a file named .valid_filename_on_Windows on Windows
- Move the file to a Mac OS X machine
- The file will not be visible via the Finder
(File and folder names beginning with a dot mean the file or folder is hidden)
Example 2
- Create a file named valid_filename_on_Mac/ on Mac OS X
- Move the file to a Windows machine
- If the file is viewed via Windows Explorer the file name will not appear as it did on the OS X machine
Example 3
- Create a file named lpt1 on Mac OS 9
- Move the file to a Windows machine
- Under Windows 2000 viewing the folder which contains the file via Explorer will result in Explorer crashing
- Under Windows 2003 the file name cannot be changed because the file will require inherent access permissions

Leave a comment