19

I often name files using a convention such that I incorporate a version number at the end, similar to Some Deliverable - v0.1.docx. Sometimes when colleagues make changes and send back revised versions they will update that version number, but they will also replace the extra period with a space, such as Some Deliverable - v0 2.docx.

This happens often enough, with a wide enough variety of colleagues, that I wonder: Is there still a danger in naming a file with multiple periods? Are my colleagues being overly cautious or taking valid precautions? And if it is a valid precaution, under what circumstances would a file with multiple periods cause problems?

If this is a holdover from pre-Windows 95 days or something then I'm not worried, but if this is something that, for example, causes problems when sharing a file with a Mac user – or an iPad user? – or a Linux user then I'll change my ways and stick to one period in a file name, before the extension.

12
  • 5
    I never had any problems in using multiple dots in file names. Not under GNU/linux (ext2 fs), nor on FreeBSD, nor on windows (FAT32 and NTFS). Accessing such files via a samba network always worked. I strongly suspect that there is no problem.
    – Hennes
    Jul 18, 2012 at 19:12
  • 2
    Especially considering that Linux and OS X users have dealt with files named something-v1.23.4-something.tar.gz.sig for years without any troubles...
    – user1686
    Jul 18, 2012 at 19:13
  • 2
    i.dont.even.know.if.youre.serious.or.trolling.mr.ebgreen...
    – user1686
    Jul 18, 2012 at 19:15
  • 1
    Meh...an impossible dream I know. Not intended to be a troll. Just years of writing regexes and string parsing routines that are more complex than they would be if users were restricted to my ideal keyboard. I would of course get a full keyboard as per the double standard that is the perogative of IT professionals everywhere...
    – EBGreen
    Jul 18, 2012 at 19:27
  • 1
    The multiple extensions warning was for windows. With the default windows [explorer] configuration "some_virus.jpg.exe" would show up as a seemlingly harmless picture file named "some_virus.jpg".
    – Hennes
    Jul 18, 2012 at 20:51

3 Answers 3

19

Theory

Since long filenames and VFAT exist, filenames with two periods in them are perfectly valid in Windows.

As far as the modern file system is concerned, there's no such thing as an extension. A period is a character like any else. The GUI treats everything that follows the last period as the file's extension.

Linux always behaved this way.

Practice

SharePoint, ProFTP, TransferText, Symphony, KVR Audio and servedir all have or had some problem with multiple periods in filenames.

However, not handling multiple periods properly is ultimately a bug. It's easy to make a mistake when spitting up a filename in its basename and extension, but the problem is the program, not the filename.

5
  • 4
    In a way, there is such a thing as an extension, and it has very similar treatment in both Windows and Unix – in particular, it is widely used in GUIs (practically every Linux GUI file manager), mainly to decide which file type and icon to show, while avoiding expensive "magic number" tests; however, practically irrelevant in CLIs where the user chooses the program themselves. Yes, even on Windows, the .exe extension is irrelevant in command line; you can name a file notepad.jpg and it will still run.
    – user1686
    Jul 18, 2012 at 22:28
  • 1
    However, since introduction of LFNs, the extension is not separate from the file name anymore – even on Windows, a period is a character like any else.
    – user1686
    Jul 18, 2012 at 22:28
  • @grawity: That's more or less what I wanted to write (although it didn't come out as well): Extensions became a simple convention in Windows, i.e, they're not part of the file system anymore. The notepad.jpg is interesting.
    – Dennis
    Jul 18, 2012 at 22:41
  • For what it's worth, windows compiled executeables to this day still have the 5A 4D (MZ) magic number which is the legacy of Mark Zbikowski who created the format.
    – EBGreen
    Jul 19, 2012 at 14:06
  • Hmm. SharePoint or one of the other products mentioned here might very well be the culprit; if colleagues have wanted to upload files and had troubles from multiple periods it might be why they're wary of using them. It may be a bug, but the net result is that we still have to work around it...
    – sernaferna
    Jul 19, 2012 at 15:34
4

Multiple dots have not been a problem on Windows since Windows 95, and on other operating systems for even longer.

(I never use periods because I hate adding quotation marks "" in terminal afterwards. But that's not the point of your question.)

But multiple dots in filename could cause problems in some cases, mostly with webapps and upload feature (obviously because of incorrect implementation of this feature).

2
  • 4
    In what terminal do you have to add quotation marks around filenames with (multiple) periods?
    – Sebastian
    Sep 28, 2016 at 14:16
  • It is a problem if you use libraries to get file extensions. They only ever return last occurrence
    – Epirocks
    Aug 2 at 12:56
2

I just discovered an issue under Windows Corporate XP SP3 like this. Basically I can have as many periods as I like, as long as the file name does not start with a period.

Example:

.ILS.files.in.use.DFS.20140515.0700.csv

(File copied from Unix FS to windows, this is a legit file name under Unix I believe)

When I try to rename this file, if I leave the initial period in the operation, it fails with the error message "You must type a file name."

Removing the initial period, and adding the datestamp with period separators, this shows you can have as many periods as you like (subject to other name restrictions) and is a valid Windows file name:

ILS.files.in.use.DFS.2014.05.15.0700.csv
1
  • That’s just a restriction (well, bug IMHO) with Windows Explorer. Even Command Prompt (ren command) can handle file names starting with a period.
    – Daniel B
    Jul 28, 2014 at 10:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.