It is not a bug. It is by design to prevent compatibility issues.
It is a leftover from the old DOS days.
The FAT12 (floppy) and FAT16 filesystems (FAT16 prior to long filename support introduced in Windows 95) only had file-names stored in 11 bytes:
8 bytes for the name, 3 for the extension. The "period" between name and extension wasn't even stored. It was implied and automatically added for display purposes.
Directories didn't have extensions at all. Instead the 3 bytes for the extension were filled with "$" characters (which were illegal in real names).
Because Windows is still compatible with this Explorer and many other components of Windows silently make the trailing period disappear to prevent creating compatibility issues.
As others have stated you can actually handle such folders by using the RAW semantics (\\?\ prefix before the absolute path-name).
Behind the scenes NTFS and network-filesystems have no problem with such files and folders. It is just a case of Explorer trying to prevent the user to create something that may cause problems for other software.
(In fact there are some other left-overs as well:
File-names like COM, COM1, COM2, AUX, PRN, LPT, LPT1, LPT2, LPT3, CON can cause similar issues where Explorer and many other Windows parts get all confused because these names are "reserved" names that also date back from the DOS era.)
21
Worth noting is that you stumbled across the "hack" for starting a file name with a
– jpmc26 – 2016-01-19T05:37:41.720.
in Windows.Related and possible duplicate of http://superuser.com/questions/997590/windows-unable-to-delete-file
– HamZa – 2016-01-19T09:16:03.390slightly related: linux can
cd
into._.
but not into-_-
because the-_
is an invalid option – x13 – 2016-01-19T10:24:24.4808@ThisNameBetterBeAvailable Untested, but
cd -- -_-
may possibly work. The--
is a common "end of options" marker. – TripeHound – 2016-01-19T11:18:50.07014@ThisNameBetterBeAvailable No,
--
on its own means "this is the end of the options, treat anytihing starting with-
as a literal value". Just tested:mkdir -- -_-
andcd -- -_-
works as I expected. – TripeHound – 2016-01-19T11:30:08.4173Alternatively,
./-_-
should work as well. – glglgl – 2016-01-19T14:00:58.5801Actually you can name a folder ._. on Windows-7 by using cygwin. – Robino – 2016-01-19T14:26:42.227
Maybe 7-Zip can help. – Ivan Chau – 2016-01-19T16:26:39.260
5@Alexander In linux, since that appears to be where the comments went, for
cd "-_-"
the shell uses the quotes for grouping but doesn't treat them as part of the argument; it errors withinvalid option
– Izkata – 2016-01-19T16:55:57.5632Use Linux to create a file with a dot at the end, then boot into Windows and try to delete it :) – Mark K Cowan – 2016-01-21T22:50:33.187
Windows is way too liberal on naming the files, and should really be more strict - also users could demand less. Having all kinds of characters for a filename is just vanity. They are just files. I'd rather have file CONTENTS using UTF-8 and away with the encoding problems. – diynevala – 2016-01-22T15:09:25.493
1@diynevala was that irony? Are you saying Windows should be even more strict? – Léo Lam – 2016-01-25T19:59:06.497