Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dot in file name?

Is it okay to use a "." (dot) in file names instead of camelcase or dashes etc.. for example:

ico_active.user.png

Will it cause any performance or browser compatibility issues or some other disadvantage?

Thanks!

like image 747
eozzy Avatar asked Oct 13 '10 17:10

eozzy


People also ask

Is dot allowed in file name?

Illegal Filename CharactersDon't start or end your filename with a space, period, hyphen, or underline. Keep your filenames to a reasonable length and be sure they are under 31 characters. Most operating systems are case sensitive; always use lowercase. Avoid using spaces and underscores; use a hyphen instead.

What does the dots mean in a file name?

Dot is the separator of the file name and it's extension.

What does dot before filename mean?

It means the file is hidden. Period. You may create such a file, or it can be generated by the system. There are many hidden files in your home folder storing your configurations.

Why do hidden files start with a dot?

A filesystem driver can hide any files it wants, by simply omitting their names when it provides results to system calls that are used to get a directory listing. As sergut described in his answer, files starting with a dot are not truly hidden.


2 Answers

Different OSes have different rules for filenames. For example, filenames cannot consist only of dots. In Windows filenames cannot end with a dot.

There is a convention where file types or formats trail dots; for example a something.tar.gz file is interpreted as the file or folder "something" that has been tar-ed then gzipped.

Dots are also problematic when matching filenames using regular expressions because . is a metacharacter while underscores and letters are not.

like image 50
Dour High Arch Avatar answered Sep 23 '22 06:09

Dour High Arch


If you save the response, then the last part will be used as the file name by some older browsers, but apart from that it's ignored. It used to be fun little joke to play on people to make a URI like ".jpeg" do something interactive because it was really a text/html with some javascript or flash, but these days people are too likely to know how it's done to serve as a prank any more.

IIS does have issues if the period is the final character of the URI, for reasons that escape me.

like image 41
Jon Hanna Avatar answered Sep 21 '22 06:09

Jon Hanna