[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: File names with spaces and tramp/ftp
From: |
Michael Albinus |
Subject: |
Re: File names with spaces and tramp/ftp |
Date: |
Mon, 11 Feb 2008 16:39:28 +0100 |
User-agent: |
Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (hpux) |
"Lennart Borgman (gmail)" <address@hidden> writes:
Hi Lennart,
sorry for the delay; it's always a problem for me to catch a w32
machine for testing.
> There is a problem in tramp/ftp with file names that contains spaces,
> at least on w32. I do not know if it is possible to cure this and how
> to do it.
I can reproduce it here. Tested with GNU Emacs 22.1 and the default
"ftp.exe" binary found in "c:\WINDOWS\system32\", the machine runs
"Windows XP SP2".
My test case is copying the local file "u:\file name with spaces" to
the remote directory "/tmp".
The first problem is that ange-ftp does not encode the local file name
when passing to the "put" command. It uses the command
put u:/file name with spaces /tmp/file\ name\ with\ spaces
The result is an empty file "name" on the FTP server. But even
encoding the local file name like this does not work:
put u:/file\ name\ with\ spaces /tmp/file\ name\ with\ spaces
results in an empty file "name\" on the remote server. Note that with
an FTP client on a GNU/Linux machine, this runs OK.
A sufficient encoding seems to be using double quotes:
put "u:/file name with spaces" "/tmp/file name with spaces"
gives the expected results.
I could change ange-ftp to this encoding style of file names; but I am
anxious: it could break ange-ftp on other systems, where double quotes
might not be supported. No idea whether double quote encoding works
with all possible combinations of FTP clients and servers.
Maybe the best would be a user option to decide the kind of quoting
file names? Or is it already sufficient just to encode with double
quotes, when the local host is w32? What do people think?
Best regards, Michael.
PS: As far as I see, Tramp is not involved.