Click here to Skip to main content
15,891,779 members

Survey Results

Is the "." part of a file's extension?

Survey period: 14 Nov 2022 to 21 Nov 2022

Your personal opinion, not "what my framework says". Is the "." in "filename.ext" part of the extension or not?

OptionVotes% 
The "." is part of the extension16019.28
It is NOT part of the extension52162.77
I refuse to vote because I don't care.14917.95



 
GeneralRe: It's a delimiter Pin
NPowDev15-Nov-22 1:50
NPowDev15-Nov-22 1:50 
GeneralI don't care Pin
Nelek14-Nov-22 11:05
protectorNelek14-Nov-22 11:05 
GeneralRe: I don't care Pin
PIEBALDconsult14-Nov-22 12:53
mvePIEBALDconsult14-Nov-22 12:53 
GeneralRe: I don't care Pin
trønderen15-Nov-22 0:11
trønderen15-Nov-22 0:11 
GeneralRe: I don't care Pin
PIEBALDconsult15-Nov-22 0:48
mvePIEBALDconsult15-Nov-22 0:48 
GeneralRe: I don't care Pin
Nelek15-Nov-22 2:21
protectorNelek15-Nov-22 2:21 
GeneralRe: I don't care Pin
PIEBALDconsult15-Nov-22 2:23
mvePIEBALDconsult15-Nov-22 2:23 
GeneralDepends on the file system Pin
trønderen14-Nov-22 7:15
trønderen14-Nov-22 7:15 
In FAT, the dot is not represented. Can something that is not there be a part of the extension?

In various *nix file systems, the dot is just another printable character, part of the file name. *.nix programmers have a varying awareness of an 'extension' concept; they certainly use suffixes such as .c and .h as if they were extensions, but usually insist that you may call the file whatever you want - the filename might even contain spaces! But if you do (whether naming a code file function_code.h or function code.c), they may get tremendously upset (and so may their build job, maybe even their running code)!

In NTFS (long file names), the dot is represented - both intermediate ones, being part of the file name, and the final one. So it is tempting to say that the dot is part of the extension. But under Windows, in most contexts the behavior is like FAT files, as if the dot was never there.

If you use a mixture of Microsoftware and software from other vendors, you will see a mixture of extensions with or without the dot. Some software is tolerant and strip off a dot it doesn't want (or add one it wants), others might misinterpret and give you a double dot when merging with a file name (if they want the extension without a dot) or add the (intended) extension to the file name, with an empty extension. You will have to try it out. (In the old days, we even could read the documentation, but that is just sooo last millenium!) My impression is that an increasing number of APIs handling the extension separately want it with the dot.

If the API knows that it is an extension, because that's what it asked for, it really is redundant; it doesn't add any information. Sort of like starting every WWW browser link with "WWW." (or even "https://www.". When you have to write that for all links, it ends up being nothing but clutter. Nowadays, everyone refers to "codeproject.com" - the significant part of the URL, and the browser adds the insignificant clutter.

The dot is similar clutter. I have never seen a case where an extension without a dot could be mistaken for a complete file name, so the dot doesn't add anything. If I were asked to make the decision, to include the dot or not, I'd say: Omit it.

In real life, file systems vary. So my answer is: It depends on the file system. In a *.nix file system, there is no doubt: The dot is part of the extension (provided that you recognize the extension concept at all). In FAT, it is not.
GeneralMissing option: there is no dot PinPopular
PIEBALDconsult14-Nov-22 2:13
mvePIEBALDconsult14-Nov-22 2:13 
GeneralRe: Missing option: there is no dot Pin
OriginalGriff15-Nov-22 6:50
mveOriginalGriff15-Nov-22 6:50 
GeneralRe: Missing option: there is no dot Pin
PIEBALDconsult16-Nov-22 3:32
mvePIEBALDconsult16-Nov-22 3:32 
Generalin dotnet API, extension includes the dot Pin
pierrecoach14-Nov-22 0:11
professionalpierrecoach14-Nov-22 0:11 
GeneralRe: in dotnet API, extension includes the dot Pin
RunDosRun14-Nov-22 4:34
RunDosRun14-Nov-22 4:34 
GeneralRe: in dotnet API, extension includes the dot Pin
PIEBALDconsult14-Nov-22 5:06
mvePIEBALDconsult14-Nov-22 5:06 
GeneralRe: in dotnet API, extension includes the dot Pin
Jacquers14-Nov-22 19:58
Jacquers14-Nov-22 19:58 
GeneralRe: in dotnet API, extension includes the dot Pin
trønderen15-Nov-22 0:08
trønderen15-Nov-22 0:08 
GeneralRe: in dotnet API, extension includes the dot Pin
jweled15-Nov-22 1:32
jweled15-Nov-22 1:32 
Generalthe "." is the delimiter between filename and extension PinPopular
Mike (Prof. Chuck)13-Nov-22 21:14
professionalMike (Prof. Chuck)13-Nov-22 21:14 
GeneralRe: the "." is the delimiter between filename and extension Pin
den2k8813-Nov-22 22:51
professionalden2k8813-Nov-22 22:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.