What are reserved filenames for various platforms?

erickson picture erickson · Sep 23, 2008 · Viewed 8.9k times · Source

I'm not asking about general syntactic rules for file names. I mean gotchas that jump out of nowhere and bite you. For example, trying to name a file "COM<n>" on Windows?

Answer

Jacob T. Nielsen picture Jacob T. Nielsen · Sep 23, 2008

From: http://www.grouplogic.com/knowledge/index.cfm/fuseaction/view_Info/docID/111.

The following characters are invalid as file or folder names on Windows using NTFS: / ? < > \ : * | " and any character you can type with the Ctrl key.

In addition to the above illegal characters the caret ^ is also not permitted under Windows Operating Systems using the FAT file system.

Under Windows using the FAT file system file and folder names may be up to 255 characters long.

Under Windows using the NTFS file system file and folder names may be up to 256 characters long.

Under Window the length of a full path under both systems is 260 characters.

In addition to these 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 file names are also reserved under Windows:

  • aux,
  • com1,
  • com2,
  • ...
  • com9,
  • lpt1,
  • lpt2,
  • ...
  • lpt9,
  • con,
  • nul,
  • prn