Home > Files & Folders >
Forbidden Characters in Filenames
Overview
Both Mac OS X and Windows XP place restrictions on which characters are allowed to be used in file/folder names.
If you need some laptop repair, we'll fix laptop lcd screens and add on laptop memory and have your computer run faster too.
Mac OS X
OS X prohibits only the colon : character, because this character is used to represent a directory in HFS+ (OS X's default filesystem).
If you try to use a colon in the name of a file in the Finder, the following error will be presented:

This error message is worded rather poorly. It tells the user that there is something wrong with the filename, and gives suggestions as to what it might be, but does not say anything definitive. Since colons are the only forbidden characters in filenames, it would make much more sense (and would be much clearer) if the error message simply said "the use of a colon is not permitted." Instead, this error message leaves some ambiguity, and puts the burden of figuring out what is wrong with the filename on the user.
When you try to type a colon in a save dialog, OS X handles it in a much more direct manner - it simply replaces the colon as you type it with a dash (Preview, TextEdit, Script Editor 2, and Safari tested), thus never even producing an error to begin with. This behavior strangely does not extend to the Finder.
Additionally, while you can use periods (or dots) "." in the names of your files or folders, they may not begin with one. Attempting to rename a file to start with a dot "." yields the following error:

The above dialog is a much more informative error. It not only tells the user that the dot "." is the problem, but it even explains why. Advanced users who need to create a file that starts with a dot can do so through the Terminal.
The forward slash character "/" is not expressly forbidden in OS X filenames, but Script Editor produces the following error when attempting to save a file with a "/" included in the filename:

However, the other applications we tested (Preview, TextEdit, and Safari) all allowed us to save a file with a "/" in the name.
Windows XP
XP restricts the use of the * . " / \ [ ] : ; | = , characters in a file or folder's name. When you try to type a forbidden character in a file's name, XP tells you:

This is a very explicit and helpful message. Additionally, XP will not let you begin a filename with a space or a dot. If you attempt to begin a filename with a space, the space is ignored. If you attempt to begin a filename with a dot, you'll get an error that simply says "You must type a file name" and offers no further explanation.
If you try to save a file from within an application's Save dialog box with a forbidden character, this is the error message that results:

Filename error message (from XP's Paint application)
XP discloses that the problem is with the file's name, but it leaves it up to the user to figure out how to resolve the issue. Most users will probably assume what the offending character is, but it would be much more helpful if XP simply told user like it does when working in the filesystem.
The way XP applications handle saving files does not seem to be driven exclusively by the operating system. We tried this same experiment with Microsoft Word, which produced three different errors depending on the different forbidden characters used. We mention this not as a third-party software example, but rather to illustrate that the operating system seems not to be in control of how Save dialogs handle forbidden characters.
Conclusion
Mac OS X
- Only one forbidden character "
:" for file names - Some error messages are vague while others are very explicit
XP:
- XP has more restrictions (9 total) for what characters you can use in a file/folder's name.
- Some error messages are vague while others are very explicit
Mac OS X: 7
Windows XP: 6
Back Renaming Files & Folders | Next Aliases & Shortcuts
