unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#19463: 25.0.50; Files with special chars in the name cannot be written on MS Windows
@ 2014-12-29 15:56 Michael Albinus
  2014-12-29 16:37 ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Albinus @ 2014-12-29 15:56 UTC (permalink / raw)
  To: 19463


The following problem I have observed when running tramp-tests.el on MS
Windows. It isn't a Tramp problem, 'tho.

Files with special characters in their file name cannont be written
locally. The following test is derived from tramp-test30-special-characters.
Note, that this testcase runs w/o problems under GNU/Linux.

--8<---------------cut here---------------start------------->8---
(dolist
    (file
     '(" foo\tbar baz\t"
       "$foo$bar$$baz$"
       "-foo-bar-baz-"
       "%foo%bar%baz%"
       "&foo&bar&baz&"
       "?foo?bar?baz?"
       "*foo*bar*baz*"
       "'foo\"bar'baz\""
       "#foo~bar#baz~"
       "!foo|bar!baz|"
       ":foo;bar:baz;"
       "<foo>bar<baz>"
       "(foo)bar(baz)"
       "[foo]bar[baz]"
       "{foo}bar{baz}"))
  (condition-case err
      (write-region file nil (expand-file-name file temporary-file-directory))
    (error (message "%s" (error-message-string err)))))

=>

Opening output file: invalid argument, c:/Users/Michael/AppData/Local/Temp/ foo	bar baz
Wrote c:/Users/Michael/AppData/Local/Temp/$foo$bar$$baz$
Wrote c:/Users/Michael/AppData/Local/Temp/-foo-bar-baz-
Wrote c:/Users/Michael/AppData/Local/Temp/%foo%bar%baz%
Wrote c:/Users/Michael/AppData/Local/Temp/&foo&bar&baz&
Opening output file: invalid argument, c:/Users/Michael/AppData/Local/Temp/?foo?bar?baz?
Opening output file: invalid argument, c:/Users/Michael/AppData/Local/Temp/*foo*bar*baz*
Opening output file: invalid argument, c:/Users/Michael/AppData/Local/Temp/'foo"bar'baz"
Wrote c:/Users/Michael/AppData/Local/Temp/#foo~bar#baz~
Opening output file: invalid argument, c:/Users/Michael/AppData/Local/Temp/!foo|bar!baz|
Opening output file: invalid argument, c:/Users/Michael/AppData/Local/Temp/:foo;bar:baz;
Opening output file: invalid argument, c:/Users/Michael/AppData/Local/Temp/<foo>bar<baz>
Wrote c:/Users/Michael/AppData/Local/Temp/(foo)bar(baz)
Wrote c:/Users/Michael/AppData/Local/Temp/[foo]bar[baz]
Wrote c:/Users/Michael/AppData/Local/Temp/{foo}bar{baz}
--8<---------------cut here---------------end--------------->8---

Best regards, Michael.





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

* bug#19463: 25.0.50; Files with special chars in the name cannot be written on MS Windows
  2014-12-29 15:56 bug#19463: 25.0.50; Files with special chars in the name cannot be written on MS Windows Michael Albinus
@ 2014-12-29 16:37 ` Eli Zaretskii
  2014-12-29 21:55   ` Michael Albinus
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2014-12-29 16:37 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 19463

> From: Michael Albinus <michael.albinus@gmx.de>
> Date: Mon, 29 Dec 2014 16:56:48 +0100
> 
> 
> The following problem I have observed when running tramp-tests.el on MS
> Windows. It isn't a Tramp problem, 'tho.

It's a basic documented limitation of the file APIs, at least on the
level that Emacs on Windows uses them.  See

  http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v=vs.85%29.aspx

(look under "Naming Conventions").

> Files with special characters in their file name cannont be written
> locally. The following test is derived from tramp-test30-special-characters.
> Note, that this testcase runs w/o problems under GNU/Linux.

This is expected.  What exactly do you want us to do with this issue?
Unless we radically change the way we do file I/O (similarly to what
Cygwin does), which is a very large job, this issue cannot be
resolved.

We simply should not use such file names on Windows.





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

* bug#19463: 25.0.50; Files with special chars in the name cannot be written on MS Windows
  2014-12-29 16:37 ` Eli Zaretskii
@ 2014-12-29 21:55   ` Michael Albinus
  2014-12-30  3:32     ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Albinus @ 2014-12-29 21:55 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 19463

Eli Zaretskii <eliz@gnu.org> writes:

> It's a basic documented limitation of the file APIs, at least on the
> level that Emacs on Windows uses them.  See
>
>   http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v=vs.85%29.aspx
>
> (look under "Naming Conventions").

Thanks for the link. So I will adapt that test for the MS-Windows case.

>> Files with special characters in their file name cannont be written
>> locally. The following test is derived from tramp-test30-special-characters.
>> Note, that this testcase runs w/o problems under GNU/Linux.
>
> This is expected.  What exactly do you want us to do with this issue?
> Unless we radically change the way we do file I/O (similarly to what
> Cygwin does), which is a very large job, this issue cannot be
> resolved.
>
> We simply should not use such file names on Windows.

At least we shall mention this restriction, for example in
(info "(emacs) Windows Files")

For me as native user it is not obvious, that " " is allowed, but "\t" isn't.

In your reference link, other reserved file names are also mentioned,
like NUL etc. This is something one shall know as well.

Maybe it is not necessary to document all those restrictions in the
Emacs manual. But a hint might be useful, combined with a reference
(maybe the link you have given).

Best regards, Michael.





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

* bug#19463: 25.0.50; Files with special chars in the name cannot be written on MS Windows
  2014-12-29 21:55   ` Michael Albinus
@ 2014-12-30  3:32     ` Eli Zaretskii
  2014-12-30  8:29       ` Michael Albinus
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2014-12-30  3:32 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 19463

> From: Michael Albinus <michael.albinus@gmx.de>
> Cc: 19463@debbugs.gnu.org
> Date: Mon, 29 Dec 2014 22:55:13 +0100
> 
> > This is expected.  What exactly do you want us to do with this issue?
> > Unless we radically change the way we do file I/O (similarly to what
> > Cygwin does), which is a very large job, this issue cannot be
> > resolved.
> >
> > We simply should not use such file names on Windows.
> 
> At least we shall mention this restriction, for example in
> (info "(emacs) Windows Files")

I don't mind documenting it, but traditionally there was objection to
talking too much about Windows in our manuals.





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

* bug#19463: 25.0.50; Files with special chars in the name cannot be written on MS Windows
  2014-12-30  3:32     ` Eli Zaretskii
@ 2014-12-30  8:29       ` Michael Albinus
  2014-12-30 16:02         ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Albinus @ 2014-12-30  8:29 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 19463

Eli Zaretskii <eliz@gnu.org> writes:

>> At least we shall mention this restriction, for example in
>> (info "(emacs) Windows Files")
>
> I don't mind documenting it, but traditionally there was objection to
> talking too much about Windows in our manuals.

The section I have referenced to is called "G.3 File Names on MS-Windows".
Maybe it is acceptable to add a paragraph there :-)

Best regards, Michael.





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

* bug#19463: 25.0.50; Files with special chars in the name cannot be written on MS Windows
  2014-12-30  8:29       ` Michael Albinus
@ 2014-12-30 16:02         ` Eli Zaretskii
  2014-12-30 17:38           ` Michael Albinus
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2014-12-30 16:02 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 19463

> From: Michael Albinus <michael.albinus@gmx.de>
> Cc: 19463@debbugs.gnu.org
> Date: Tue, 30 Dec 2014 09:29:16 +0100
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> At least we shall mention this restriction, for example in
> >> (info "(emacs) Windows Files")
> >
> > I don't mind documenting it, but traditionally there was objection to
> > talking too much about Windows in our manuals.
> 
> The section I have referenced to is called "G.3 File Names on MS-Windows".
> Maybe it is acceptable to add a paragraph there :-)

That's the User Manual.  I thought you were talking about the ELisp
manual, which is where I think this kind of information belongs.





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

* bug#19463: 25.0.50; Files with special chars in the name cannot be written on MS Windows
  2014-12-30 16:02         ` Eli Zaretskii
@ 2014-12-30 17:38           ` Michael Albinus
  2015-01-31 16:34             ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Albinus @ 2014-12-30 17:38 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 19463

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Michael Albinus <michael.albinus@gmx.de>
>> Cc: 19463@debbugs.gnu.org
>> Date: Tue, 30 Dec 2014 09:29:16 +0100
>> 
>> Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> >> At least we shall mention this restriction, for example in
>> >> (info "(emacs) Windows Files")
>> >
>> > I don't mind documenting it, but traditionally there was objection to
>> > talking too much about Windows in our manuals.
>> 
>> The section I have referenced to is called "G.3 File Names on MS-Windows".
>> Maybe it is acceptable to add a paragraph there :-)
>
> That's the User Manual.  I thought you were talking about the ELisp
> manual, which is where I think this kind of information belongs.

This information is important for the User Manual. People like me, who
don't know too much about MS Windows, would check this first. And even
MS Windows aficionados might not know such details about file names.

In the Elisp Manual, something is already said about these restrictions
("... On some filesystems (notably, MS-Windows), trailing whitespace
characters in file names are silently and automatically ignored.") This
could be extended of course. But I believe it would be sufficient to
give a reference to the User Manual. It doesn't happen too often, that a
developer must parse file names dedicated to MS Windows.

Best regards, Michael.





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

* bug#19463: 25.0.50; Files with special chars in the name cannot be written on MS Windows
  2014-12-30 17:38           ` Michael Albinus
@ 2015-01-31 16:34             ` Eli Zaretskii
  0 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2015-01-31 16:34 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 19463-done

> From: Michael Albinus <michael.albinus@gmx.de>
> Cc: 19463@debbugs.gnu.org
> Date: Tue, 30 Dec 2014 18:38:57 +0100
> 
> This information is important for the User Manual. People like me, who
> don't know too much about MS Windows, would check this first. And even
> MS Windows aficionados might not know such details about file names.

OK, done on the release branch.





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

end of thread, other threads:[~2015-01-31 16:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-29 15:56 bug#19463: 25.0.50; Files with special chars in the name cannot be written on MS Windows Michael Albinus
2014-12-29 16:37 ` Eli Zaretskii
2014-12-29 21:55   ` Michael Albinus
2014-12-30  3:32     ` Eli Zaretskii
2014-12-30  8:29       ` Michael Albinus
2014-12-30 16:02         ` Eli Zaretskii
2014-12-30 17:38           ` Michael Albinus
2015-01-31 16:34             ` Eli Zaretskii

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).