Subject: Trouble with Unusual File Names in Dired Mode

From: [email-masked] (David S. Rosinger)
Date: Thu, 17 Oct 96 11:19:05 EDT

BACKGROUND

    I've just noticed some trouble with the handling of
    certain files in Dired.  If the first character
    of the filename is `~' or `*', some unusual
    things happen.

EXAMPLE #1

    For example, suppose I create a file (with `notepad')
    and name it `~junk.txt'.

    1. Initially, the file does not show up in Dired.

    2. If I run an Emacs shell, and then I refresh the Dired buffer,
       the file suddenly shows up in Dired.

    3. If I create a new buffer and name it `~junk2.txt',
       the path attached to that buffer is in *another*
       directory.

EXAMPLE #2

    Here's another related problem:

    4. If I create a new buffer and name it `*junk.txt',
       I cannot save it.

SUMMARY

    I am running version 19.33.1 as distributed from the
    NT Emacs site on Windows NT 4.0 on a FAT file system.
    Can anyone confirm this behavior and tell me if it is
    unique to NT/95?

    Andrew (Innes), is this issue possibly related to the
    work you recently did to handle long file names?

-- 
+------------------------------------------------+
| David S. Rosinger         /  [email-masked] |
| Intergraph Corporation   /   (703) 264-5737    |
+------------------------------------------------+

---

From: Andrew Innes <[email-masked]>
Date: Tue, 19 Nov 1996 15:11:27 GMT

[Trawling through old mail...]

>    of the filename is `~' or `*', some unusual

 [ .. ]

>    work you recently did to handle long file names?

There are two separate problems here: ~ at the start of a pathname
element has special meaning to Emacs - it is the syntax for referring to
home directories by user name.  It should be possible to escape the
tilde to override this interpretation, but this doesn't work on NT (or
indeed on Unix either).  This is a known problem with `expand-file-name'
which I've been asked to fix at some point.

The second problem is simply that '*' is an illegal character in
filenames on NT and Windows.

AndrewI