Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In a filename, is the dot . a part of the file extension?

A file has a filename and an extension and these are usually written with a dot (a full stop) between them as a delimiter. This description tells us that the dot is not a part of the extension but when stating extension we usually include the dot.

For example a PNG file with filename "image" is usually written as image.png. But we usually say the .png extension like the dot is a part of the extension. I'm just curious, is the dot a delimeter between them or a part of the extension, i.e. is the extension "png" or is it ".png"?

like image 554
Jesper Lundin Avatar asked Nov 26 '22 13:11

Jesper Lundin


1 Answers

According to the Wikipedia article on File extensions:

The exact definition, giving the criteria for deciding what part of the file name is its extension, belongs to the rules of the specific filesystem used; usually the extension is the substring which follows the last occurrence, if any, of the dot character.

"png" is technically the file extension, though you always look for the file extension after the final full-stop.

like image 124
Katamari Avatar answered Nov 29 '22 04:11

Katamari