Re: dot (.) files and directories



The period (.) cannot be the first or only character in the filename or
foldername.

<quote>
Do not end a file or directory name with a trailing space or a period.
Although the underlying file system may support such names, the operating
system does not.
<quote>
from...
Naming a File
https://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/naming_a_file.asp

<quote>
You may not be able to delete a file if the file name includes an invalid
name (for example, the file name has a trailing space or a trailing period
or the file name is made up of a space only).
<quote>
from...
You cannot delete a file or a folder on an NTFS file system volume
http://support.microsoft.com/?kbid=320081

<quote>
XP restricts the use of the * . " / \ [ ] : ; | = , characters in a file or
folder's name. When you try to type a forbidden character in a
file's name, XP tells you:

A file name cannot contain any of the following characters:
\ / : * ? " < > |

This is a very explicit and helpful message. Additionally, XP will not let
you begin a filename with a space or a dot. If you attempt to begin a
filename with a space, the space is ignored. If you attempt to begin a
filename with a dot, you'll get an error that simply says "You must type a
file name" and offers no further explanation.

If you try to save a file from within an application's Save dialog box with
a forbidden character, this is the error message that results:

sample>filename
The above file name is invalid.

XP discloses that the problem is with the file's name, but it leaves it up
to the user to figure out how to resolve the issue. Most users will probably
assume what the offending character is, but it would be much more helpful if
XP simply told user like it does when working in the filesystem.

The way XP applications handle saving files does not seem to be driven
exclusively by the operating system. We tried this same experiment with
Microsoft Word, which produced three different errors depending on the
different forbidden characters used. We mention this not as a third-party
software example, but rather to illustrate that the operating system seems
not to be in control of how Save dialogs handle forbidden characters.
<quote>
from...
Forbidden Characters in Filenames - XvsXP.com, Mac OS X vs. Windows XP
http://www.xvsxp.com/files/forbidden.php

There are ways around some of the restrictions, but trying to delete the
file or folder with illegal characters can be a real pain.

Using Windows Explorer:
It is possible to save a file as .txt no name, just an extension.

It is possible to name a folder with a space, i.e. no name.

For some of the other restrictions you have to use a command prompt, not
windows Explorer.

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In news:1155258548.884786.310830@xxxxxxxxxxxxxxxxxxxxxxxxxxx,
kramer.newsreader@xxxxxxxxx <kramer.newsreader@xxxxxxxxx> hunted and pecked:
My ssh client is trying create a fdirectory ".ssh" and it is giving an
error, so I tried to create that directory and can't. In fact, I can't
create any file name starting with a '.' I get the error message 'You
must type a file name'. I could have sworn that I'd created such files
in the past...



According to this:
http://blogs.msdn.com/brian_dewey/archive/2004/01/19/60263.aspx, the
NTFS/POSIX subsystem has few constraints and the Win32 subsystem (which
should be the bottleneck here restricts trailing dots and spaces and
name length, but I don't see anything about begining with a '.'

If Win32 truly does not allow filenames starting with a '.', then could
I advocate strings up the retards at MS would made such a design
decision. Is there something funny going on with my system or is this
another case where Linux/OS X/every other OS I've used is superior?

.



Relevant Pages

  • Re: determine default filename encoding
    ... > Suse tech support for the way filename characters are represented, ... Characters are characters - just bytes. ... Then if that coding differed from the LANG coding ... filenames that were written in encoding X as they were written, ...
    (comp.os.linux.setup)
  • Re: unix filename restriction
    ... underscore _ and the dot. ... You could use other characters, ... never met a *human* defined path of more than 80 chars (most of the ... If you want to be very sure, limit your filename to the DOS limit of 8 ...
    (comp.os.linux.development.apps)
  • Re: Mandis Quotes (aka retiring """ and )
    ... characters not be allowed, ... Then I remembered string ... Any binary data can be inside the quote. ...
    (comp.lang.python)
  • Re: John Ringo Forsees a Glorious Future
    ... entertaining) to quote the disclaimer from "Kildar": ... This is a work of fiction. ... All the characters and events portrayed in this book are fictional, ... Heck, there is no Kildar. ...
    (rec.arts.sf.written)
  • Re: ISE & VHDL : how to include time/date
    ... the backslash-escaped quote characters are pretty ugly. ... Now the literal quote characters are part of the GDATE_with_space ... project set {Generics, Parameters} $GDATE_with_space \ ... I used a backslash character to allow line continuation; ...
    (comp.arch.fpga)