all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Problem with non-valid file names on w32
@ 2006-11-30 13:10 Lennart Borgman
  2006-11-30 14:08 ` Juanma Barranquero
  2006-12-01 10:39 ` Eli Zaretskii
  0 siblings, 2 replies; 8+ messages in thread
From: Lennart Borgman @ 2006-11-30 13:10 UTC (permalink / raw)


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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-12-01 20:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-30 13:10 Problem with non-valid file names on w32 Lennart Borgman
2006-11-30 14:08 ` Juanma Barranquero
2006-11-30 15:55   ` Lennart Borgman
2006-12-01 20:55     ` Stuart D. Herring
2006-11-30 17:52   ` Mathias Dahl
2006-11-30 19:25     ` Juanma Barranquero
2006-12-01 10:39 ` Eli Zaretskii
2006-12-01 11:12   ` Juanma Barranquero

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.