Dot in file name?

Viewed 19212

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!

5 Answers

Dots in filenames...

  • can be somewhat problematic
  • certainly make more work when processing filenames
  • are best avoided if you can!

Consider:

  1. A dot is used as the separator between base-filename and extension.
  2. "." & ".." are reserved to represent the current & parent directory.
  3. On *nix systems a dot at the start of a filename makes it a hidden file.
    • Thus on a Mac in Finder you are not allowed to give a file a name starting with a dot: Mac Error
  4. On Windows you are not allowed to have a dot at the end of a filename
    • so dots at the end are simply removed
  5. Multiple dots
    • could represent multiple (embedded) extensions, for example: something.tar.gz
    • or other information, like version numbers, for example: something_version.1.2.6.ext
  6. When copying files between different systems
    • what works on one system may not on the other.
    • It is not possible to copy a file with a dot at the end of its name from mac to pc
    • It is not possible to copy a file with a dot at the beginning of its name from pc to mac

Unsurprisingly, certain programs have problems when files have dots in their names, for example:

  • Mail apps cannot correctly, automatically link a file-with-a-dot-at-the-end in a text mail, because the trailing dot will be interpreted as the dot at the end of the sentence Email link fail
  • FileMaker databases cannot correctly introspect, if they have dots in their names
  • and many more!

Clearly the semantics of dots in filenames is quite complicated, confused & confusing.

Just.stay.away!

Related