Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I started using DOS back before Windows, and ever since have taken it for granted that

  • Every file has a file extension, like .txt, .jpg, etc
  • That extension is always short (usually 3 letters)

I learned early that the extension is basically just a hint to the OS as to what the content type is. Eventually I got exposed to Mac and Linux, files with no extensions, etc. And of course I've seen shorter extensions, like .rb and .py.

I just noticed that markdown-formatted files can have the extension .markdown, and it made me wonder - how long can that extension be? If I make it .mycrazylongextensiontypewoohoo, will certain operating systems or programs choke on the file? Are extension names generally short just for convenience, or is this based on some limitation, legacy or current?

share|improve this question
    
File names like .VolumeIcon.icns will make your head spin :-) –  Daniel Beck Jan 14 '11 at 16:54
    
@Daniel Beck But the extension only has 4 letters, so nothing strange there. –  AndrejaKo Jan 14 '11 at 17:14
    
@AndrejaKo But there's two of them, and nothing else! –  Daniel Beck Jan 14 '11 at 17:24
    
@Daniel Beck No, there's only one extension, which is marked by the first dot when reading from right to left. The rest is filename which contains a dot. It does look confusing. –  AndrejaKo Jan 14 '11 at 18:47
1  
@AndrejaKo And once again the web fails to convey irony. Sorry about that. –  Daniel Beck Jan 15 '11 at 0:42

3 Answers 3

up vote 2 down vote accepted

Some operating systems limit the length of the extension (such as DOS and OS/2, to three characters) while others (such as Unix) do not. Some operating systems (for example RISC OS) do not use filename extensions. Unix accepts the separator dot as a legal character but does not give it a special recognition on the OS level.

http://en.wikipedia.org/wiki/Filename_extension

.

Discussion here

http://stackoverflow.com/questions/417103/max-file-extension-length

share|improve this answer
    
+1 since I stole from your post, thanks Moab. –  Kyle Jan 14 '11 at 17:02

For filesystems without the three-character extension limit, there's generally no limit on the length of the extension, only on the total length of the filename including the extension (e.g. 255 bytes for the ext3 filesystem used in Linux).

share|improve this answer

I wish I could give you a more in depth reason but I can't seem to find the sources I am looking for right now. However thinking back to the 8.3 file name standard in DOS I believe it was based on limitations with the FAT file system. This article will describe it better than I can. For Linux or Unix I believe you could have whatever size extension you want, since as Moab said the OS won't give it special recognition and thus can't choke on it.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.