unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Lennart Borgman <lennart.borgman.073@student.lu.se>
Subject: Problem with non-valid file names on w32
Date: Thu, 30 Nov 2006 14:10:45 +0100	[thread overview]
Message-ID: <456ED855.9070006@student.lu.se> (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.

             reply	other threads:[~2006-11-30 13:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-30 13:10 Lennart Borgman [this message]
2006-11-30 14:08 ` Problem with non-valid file names on w32 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=456ED855.9070006@student.lu.se \
    --to=lennart.borgman.073@student.lu.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).