emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with non-valid file names on w32


From: Lennart Borgman
Subject: Problem with non-valid file names on w32
Date: Thu, 30 Nov 2006 14:10:45 +0100
User-agent: Thunderbird 1.5.0.8 (Windows/20061025)

Emacs does not try to find out whether a file name is valid when you for example runs find-file. On w32 you can do things like this:

   C-x C-f c:/some/path/hello<there.txt

This will open a new buffer with buffer-file-name equal to "c:/some/path/hello<there.txt". This is an invalid file name on w32.

You can do similar things with emacsclient:

   C:\> emacsclient "c:/some/path/hello<there.txt"

which leads to similar results.

When you try to save the file Emacs will be noted about the problem and tell the user. So maybe it is not that catastrophic, but it is not pretty IMO.

It gets a bit worse if you have file names like "c:/some/path/d:hidden.txt". In this case Emacs will not complain when saving the file. Instead a hidden stream is created.

I think it would be good to check for the forbidden characters, probably then when expanding a file name. I think that many users would feel more comfortable if Emacs behaved that way. This seems to be the way our famous relative Notepad does it. (Except for the awkward hidden case.)

BTW, the characters that are invalid in w32 file names are:

  :*?\"<>|

Unfortunately I know no good way (ie a w32 API) to test if a file name is valid, but an easy workaround is of course to search for these characters.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]