views:

62

answers:

4

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!

A: 

Yes it is. It will look at the trailing .* for the "File Extension".

Jacob Nelson
A: 

Dot is about as safe a punctuation character as there is, except that many systems at least partially determine (assume?) the type of contents from what follows the last dot in the name.

Jonathan Leffler
+1  A: 

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.

Jon Hanna
+1  A: 

Different OSes have different rules for filenames. For example, in Unix filenames that start with a dot are hidden from shell commands by default. In Windows filenames cannot end with a dot. In both, filenames cannot consist only of dots.

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

Dour High Arch
The names "." and ".." are reserved (for current directory and parent directory), but "..." and "...." are perfectly viable file names (or directory names) on Unix systems.
Jonathan Leffler