If I want to create a new file extension for a binary/text data file that will open on my own application (extension ".mylongfileextensionname" for example), will Windows list it with my aplication (considering that I already listed it on Windows Registry before)? There is a length limit, I mean, on my example should I use ".mylong" or any specific layout?
2 Answers
Besides the fact that any filename cannot be longer then 255 characters, there is no limit imposed on a file extension length. This is because the file's extension is not separate from, but is a part of the filename itself.
While you are free to use any length of extension you wish, I would not recommend using a very lengthy one for one reason: convention. Most file extensions are three to four alphanumeric characters. Anything longer, or with funny characters, is going to "stand out" quite a bit more, be harder to memorize, and may be less likely to be adopted (again, it all depends). For a list of common file extensions, see this website.
Also, note that a file extension is completely arbitrary - it does not directly specify what the contents of a file are, it only implies what the contents should or could be.
- 34,227
- 10
- 105
- 149
I always thought 255 total as in Breakthrough's answer but I found this to be contradictory as I started to double-check my thoughts:
Windows 2000 has a 254 character limit.
Windows XP has a 255 character limit.
Windows Vista and Windows 7 has a 260 character limit.
Path+Filename limit is 260 characters.
Confirmed on this Microsoft site:
http://windows.microsoft.com/en-US/windows-vista/File-names-and-file-name-extensions-frequently-asked-questions (expand "What is the maximum length of a file name?")
http://msdn.microsoft.com/en-us/library/aa365247(v=vs.85).aspx
- 25,519
- 5
- 48
- 72
-
3fyi: http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx .. by using the "other" version of the file api you can use up to 32k chars for the path/filename. by "other" i mean the unicode one which is triggered by using unc paths ala "\\?\" – akira Jan 28 '14 at 22:14