views:

171

answers:

4

I am creating a utility that will store data on flat file in a specific binary format. I want the filename extension to be specific to my application. Is there any reason other than the old 8.3 filename limit for restricting the extension to 3 characters, and if not, what is the limit? Can I have myfilename.MyExtensionSoHandsOffEverybodyElse ?

+5  A: 

In my experience, having seen a few non-3-character extensions I'd say that it's a matter of tradition, and you're perfectly welcome to use myfilename.MyExtensionSoHandsOffEverybodyElse.

Sukasa
+6  A: 

This is a hold over from the old windows 3.x/MSDOS days. Today, there are plenty of file names that have more than 3 character extensions.

If I remember correctly, Windows XP had a maximum character limit for path names (including the file name) of 255 characters.

Kyle Trauberman
a quick grep returns 1,000's of *.html files on my environment (among many other *.project, *.config, *.settings, etc.)
scunliffe
actually, it is from MS DOS - not windows
Tim
I knew that. :P
Kyle Trauberman
+4  A: 

The only good reason for doing this is if you plan to support Windows 9x. If you're only targeting XP and later, as with most projects nowdays, the 8.3 thing is irrelevant.

In fact, Windows itself stores things in long-extension filenames in Vista and later, for example, .search-ms for saved searches.

MiffTheFox
Windows 95/98 support long file names.
Kyle Trauberman
Yeah - you need to go back to MS-DOS 6.11, and even that had utilities to manage long filenames IIRC
David Kemp
+2  A: 

No, there isn't a good reason to limit the extension to 3 characters. However, a shorter, descriptive name is better if a user has to remember it. For example, most people know what a .html or .doc file would contain.

As long as you make a reasonable attempt to avoid naming collisions with major software there shouldn't be an issue. A corollary to that is the fact that unless you create some insanely long extension that will only ever be unique to your software (and even then, it's not guaranteed), the extension you choose will always be subject to name collision by other people's software when they choose their program's data file extension as you are doing here.

Jon Seigel