Should file names contain multiple periods?

17

2

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.

sernaferna

Posted 2012-07-18T19:06:33.777

Reputation: 252

5I 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 – 2012-07-18T19:12:48.333

2Especially 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 – 2012-07-18T19:13:59.190

I agree that there is no problem per se, but if I had my druthers, I would make all users use keyboards with nothing but the letters of the alphabet and a period. Not even a space bar or a shift key. – EBGreen – 2012-07-18T19:14:15.810

2i.dont.even.know.if.youre.serious.or.trolling.mr.ebgreen... – user1686 – 2012-07-18T19:15:22.247

I've seen warnings about files having multiple extensions, but I don't remember if that was Windows or a browser or what. I haven't used any version of Windows newer than XP on a daily basis, so I don't know if there's something in the additional security layers of Vista/7 that might be complaining. As @grawity said, Linux and OS X users have had multiple periods in their files for years. – ND Geek – 2012-07-18T19:20:21.717

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 – 2012-07-18T19:27:50.243

1The 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 – 2012-07-18T20:51:59.367

@Hennes, except that with that default configuration, the ".jpg" extension shouldn't have been visible, so when you see it, it's a sign that it's not the real extension. – Wyzard – 2012-07-18T23:45:18.697

Aye. Should have. All the people who failed to notice that and messed up their computers came running to me (well, to IT) to fix their computers. Many of them bright enough to have realized something was odd if only one file showed an extension. – Hennes – 2012-07-18T23:48:37.197

1@Hennes: It could be that some didn't notice this because they don't know whether their mail program honors the "hide extension" setting or not when listing attachments. – user1686 – 2012-07-19T10:21:46.293

Answers

15

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.

Dennis

Posted 2012-07-18T19:06:33.777

Reputation: 42 934

3In 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 – 2012-07-18T22:28:37.763

1However, 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 – 2012-07-18T22:28:55.297

@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 – 2012-07-18T22:41:48.367

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 – 2012-07-19T14:06:59.023

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 – 2012-07-19T15:34:34.690

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).

user98645

Posted 2012-07-18T19:06:33.777

Reputation:

3In what terminal do you have to add quotation marks around filenames with (multiple) periods? – Sebastian – 2016-09-28T14:16:26.107

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

drewdqueue

Posted 2012-07-18T19:06:33.777

Reputation: 21

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 – 2014-07-28T10:46:50.837