unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* ange-ftp using binary mode
@ 2012-02-10 21:55 Ken Goldman
  2012-02-11  7:01 ` Eli Zaretskii
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Ken Goldman @ 2012-02-10 21:55 UTC (permalink / raw)
  To: help-gnu-emacs

I have to use ange-ftp because the server I'm connecting to doesn't run 
ssh.  When I transfer, it uses binary, which does not work.  The server 
is a mainframe and likely uses ebcdic.

If I ftp from the command line in ascii mode, the file comes over to 
Windows correctly.  If I enter the commands by hand in the ange-ftp, 
setting ascii, it works.

How do I tell ange-ftp to use ascii?

I set ange-ftp-binary-file-name-regexp to "", even though the .cpp file 
wasn't in the regexp.

Here's a trace.

quote mdtm /SYSTEM/home/suimgvb/ken/utils.cpp
501 command aborted -- FTP server not configured for MDTM
type binary
200 Representation type is Image
get /SYSTEM/home/suimgvb/ken/utils.cpp 
c:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ange-ftp4280SMK
200 Port request OK.
125 Sending data set /SYSTEM/home/suimgvb/ken/utils.cpp

250 Transfer completed successfully.
ftp: 1407 bytes received in 0.01Seconds 93.80Kbytes/sec.
type ascii
200 Representation type is Ascii NonPrint
quote mdtm /SYSTEM/home/suimgvb/ken/utils.cpp
501 command aborted -- FTP server not configured for MDTM




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

* Re: ange-ftp using binary mode
  2012-02-10 21:55 ange-ftp using binary mode Ken Goldman
@ 2012-02-11  7:01 ` Eli Zaretskii
  2012-02-15 20:17   ` Ken Goldman
  2012-02-14 13:54 ` Michael Albinus
  2012-02-15 21:30 ` Ken Goldman
  2 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2012-02-11  7:01 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Ken Goldman <kgold@watson.ibm.com>
> Date: Fri, 10 Feb 2012 16:55:49 -0500
> 
> I have to use ange-ftp because the server I'm connecting to doesn't run 
> ssh.  When I transfer, it uses binary, which does not work.  The server 
> is a mainframe and likely uses ebcdic.

Are you using ange-ftp via "C-x C-f"?  If so, tell Emacs to decode the
file, as in "C-x RET c ebcdic-us RET C-x C-f whatever RET".

If you use some other command, again prefix that command with
universal-coding-system-argument ("C-x RET c") to tell it to use
EBCDIC, or whatever is right for those files.

IOW, just imagine the file was on your local disk, and do the same.
You cannot tell disk I/O to "use ascii", can you?



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

* Re: ange-ftp using binary mode
  2012-02-10 21:55 ange-ftp using binary mode Ken Goldman
  2012-02-11  7:01 ` Eli Zaretskii
@ 2012-02-14 13:54 ` Michael Albinus
  2012-02-15 19:59   ` Ken Goldman
  2012-02-15 21:30 ` Ken Goldman
  2 siblings, 1 reply; 10+ messages in thread
From: Michael Albinus @ 2012-02-14 13:54 UTC (permalink / raw)
  To: Ken Goldman; +Cc: help-gnu-emacs

Ken Goldman <kgold@watson.ibm.com> writes:

> I have to use ange-ftp because the server I'm connecting to doesn't
> run ssh.  When I transfer, it uses binary, which does not work.  The
> server is a mainframe and likely uses ebcdic.
>
> If I ftp from the command line in ascii mode, the file comes over to
> Windows correctly.  If I enter the commands by hand in the ange-ftp,
> setting ascii, it works.
>
> How do I tell ange-ftp to use ascii?
>
> I set ange-ftp-binary-file-name-regexp to "", even though the .cpp
> file wasn't in the regexp.

`ange-ftp-binary-file-name-regexp' tells, which files are to be
transferred in binary mode. "" matches ALL files. So you must set it to
a regexp, which doesn't match any file name, like "^$" (which is the
empty file name).

Best regards, Michael.



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

* Re: ange-ftp using binary mode
  2012-02-14 13:54 ` Michael Albinus
@ 2012-02-15 19:59   ` Ken Goldman
  0 siblings, 0 replies; 10+ messages in thread
From: Ken Goldman @ 2012-02-15 19:59 UTC (permalink / raw)
  To: help-gnu-emacs

On 2/14/2012 8:54 AM, Michael Albinus wrote:
> Ken Goldman<kgold@watson.ibm.com>  writes:
>
>> I have to use ange-ftp because the server I'm connecting to doesn't
>> run ssh.  When I transfer, it uses binary, which does not work.  The
>> server is a mainframe and likely uses ebcdic.
>>
>> If I ftp from the command line in ascii mode, the file comes over to
>> Windows correctly.  If I enter the commands by hand in the ange-ftp,
>> setting ascii, it works.
>>
>> How do I tell ange-ftp to use ascii?
>>
>> I set ange-ftp-binary-file-name-regexp to "", even though the .cpp
>> file wasn't in the regexp.
>
> `ange-ftp-binary-file-name-regexp' tells, which files are to be
> transferred in binary mode. "" matches ALL files. So you must set it to
> a regexp, which doesn't match any file name, like "^$" (which is the
> empty file name).

I tried this, but it still transfers in binary.

~~~~~~~~

ange-ftp-binary-file-name-regexp is a variable defined in `ange-ftp.el'.
Its value is "^$"

~~~~~~~~~~
ftp trace:
~~~~~~~~~~

quote mdtm /SYSTEM/home/suimgvb/ken/client.cpp
501 command aborted -- FTP server not configured for MDTM
type binary
200 Representation type is Image
get /SYSTEM/home/suimgvb/ken/client.cpp 
c:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ange-ftp5768MyT
200 Port request OK.
125 Sending data set /SYSTEM/home/suimgvb/ken/client.cpp

250 Transfer completed successfully.
ftp: 38381 bytes received in 0.08Seconds 485.84Kbytes/sec.
type ascii
200 Representation type is Ascii NonPrint
quote mdtm /SYSTEM/home/suimgvb/ken/client.cpp
501 command aborted -- FTP server not configured for MDTM





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

* Re: ange-ftp using binary mode
  2012-02-11  7:01 ` Eli Zaretskii
@ 2012-02-15 20:17   ` Ken Goldman
  2012-02-15 20:49     ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Ken Goldman @ 2012-02-15 20:17 UTC (permalink / raw)
  To: help-gnu-emacs

On 2/11/2012 2:01 AM, Eli Zaretskii wrote:
>> From: Ken Goldman<kgold@watson.ibm.com>
>> Date: Fri, 10 Feb 2012 16:55:49 -0500
>>
>> I have to use ange-ftp because the server I'm connecting to doesn't run
>> ssh.  When I transfer, it uses binary, which does not work.  The server
>> is a mainframe and likely uses ebcdic.
>
> Are you using ange-ftp via "C-x C-f"?  If so, tell Emacs to decode the
> file, as in "C-x RET c ebcdic-us RET C-x C-f whatever RET".
>
> If you use some other command, again prefix that command with
> universal-coding-system-argument ("C-x RET c") to tell it to use
> EBCDIC, or whatever is right for those files.
>
> IOW, just imagine the file was on your local disk, and do the same.
> You cannot tell disk I/O to "use ascii", can you?

I tried this and it is somewhat better.  I can see the text but all the 
newline appears as \205, [ as \255 and ] as \275.

I think I simply want to tell ange-ftp to use ascii, not binary, but 
nothing I tried works.




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

* Re: ange-ftp using binary mode
  2012-02-15 20:17   ` Ken Goldman
@ 2012-02-15 20:49     ` Eli Zaretskii
  2012-02-15 21:25       ` Ken Goldman
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2012-02-15 20:49 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Ken Goldman <kgold@watson.ibm.com>
> Date: Wed, 15 Feb 2012 15:17:26 -0500
> 
> I tried this and it is somewhat better.  I can see the text but all the 
> newline appears as \205, [ as \255 and ] as \275.

Maybe it's not EBCDIC after all.



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

* Re: ange-ftp using binary mode
  2012-02-15 20:49     ` Eli Zaretskii
@ 2012-02-15 21:25       ` Ken Goldman
  0 siblings, 0 replies; 10+ messages in thread
From: Ken Goldman @ 2012-02-15 21:25 UTC (permalink / raw)
  To: help-gnu-emacs

On 2/15/2012 3:49 PM, Eli Zaretskii wrote:
>> From: Ken Goldman<kgold@watson.ibm.com>
>> Date: Wed, 15 Feb 2012 15:17:26 -0500
>>
>> I tried this and it is somewhat better.  I can see the text but all the
>> newline appears as \205, [ as \255 and ] as \275.
>
> Maybe it's not EBCDIC after all.

If it's not, it's close, as your suggestion to use
ebcdic-us made it much better.




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

* Re: ange-ftp using binary mode
  2012-02-10 21:55 ange-ftp using binary mode Ken Goldman
  2012-02-11  7:01 ` Eli Zaretskii
  2012-02-14 13:54 ` Michael Albinus
@ 2012-02-15 21:30 ` Ken Goldman
  2012-02-16 10:42   ` Michael Albinus
  2 siblings, 1 reply; 10+ messages in thread
From: Ken Goldman @ 2012-02-15 21:30 UTC (permalink / raw)
  To: help-gnu-emacs

On 2/10/2012 4:55 PM, Ken Goldman wrote:
> I have to use ange-ftp because the server I'm connecting to doesn't run
> ssh. When I transfer, it uses binary, which does not work. The server is
> a mainframe and likely uses ebcdic.
>
> If I ftp from the command line in ascii mode, the file comes over to
> Windows correctly. If I enter the commands by hand in the ange-ftp,
> setting ascii, it works.
>
> How do I tell ange-ftp to use ascii?

Following up my own post, I edited ange-ftp.el and changed 'binary' to 
'ascii'.  Files now come across absolutely perfectly.

I know that's an awful hack, but it's a proof of concept.  Now, how do I 
convince ange-ftp to use ascii without editing the elisp source?







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

* Re: ange-ftp using binary mode
  2012-02-15 21:30 ` Ken Goldman
@ 2012-02-16 10:42   ` Michael Albinus
  2012-02-23 19:59     ` Ken Goldman
  0 siblings, 1 reply; 10+ messages in thread
From: Michael Albinus @ 2012-02-16 10:42 UTC (permalink / raw)
  To: Ken Goldman; +Cc: help-gnu-emacs

Ken Goldman <kgold@watson.ibm.com> writes:

> On 2/10/2012 4:55 PM, Ken Goldman wrote:
>> I have to use ange-ftp because the server I'm connecting to doesn't run
>> ssh. When I transfer, it uses binary, which does not work. The server is
>> a mainframe and likely uses ebcdic.
>>
>> If I ftp from the command line in ascii mode, the file comes over to
>> Windows correctly. If I enter the commands by hand in the ange-ftp,
>> setting ascii, it works.
>>
>> How do I tell ange-ftp to use ascii?
>
> Following up my own post, I edited ange-ftp.el and changed 'binary' to
> ascii'.  Files now come across absolutely perfectly.
>
> I know that's an awful hack, but it's a proof of concept.  Now, how do
> I convince ange-ftp to use ascii without editing the elisp source?

Which Emacs version are you running?

Last year, there was a bug report about ange-ftp's binary mode, see
<http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7383>. IIRC, it was about
ange-ftp always using binary mode, when your local system is MS
Windows. This is fixed meanwhile.

Chances are good, that a prerelease of Emacs 24.1 works for you out-of-the-box.

Best regards, Michael.



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

* Re: ange-ftp using binary mode
  2012-02-16 10:42   ` Michael Albinus
@ 2012-02-23 19:59     ` Ken Goldman
  0 siblings, 0 replies; 10+ messages in thread
From: Ken Goldman @ 2012-02-23 19:59 UTC (permalink / raw)
  To: help-gnu-emacs

On 2/16/2012 5:42 AM, Michael Albinus wrote:
> Ken Goldman<kgold@watson.ibm.com>  writes:
>
>> On 2/10/2012 4:55 PM, Ken Goldman wrote:
>>> I have to use ange-ftp because the server I'm connecting to doesn't run
>>> ssh. When I transfer, it uses binary, which does not work. The server is
>>> a mainframe and likely uses ebcdic.
>>>
>>> If I ftp from the command line in ascii mode, the file comes over to
>>> Windows correctly. If I enter the commands by hand in the ange-ftp,
>>> setting ascii, it works.
>>>
>>> How do I tell ange-ftp to use ascii?
>>
>> Following up my own post, I edited ange-ftp.el and changed 'binary' to
>> ascii'.  Files now come across absolutely perfectly.
>>
>> I know that's an awful hack, but it's a proof of concept.  Now, how do
>> I convince ange-ftp to use ascii without editing the elisp source?
>
> Which Emacs version are you running?
>
> Last year, there was a bug report about ange-ftp's binary mode, see
> <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7383>. IIRC, it was about
> ange-ftp always using binary mode, when your local system is MS
> Windows. This is fixed meanwhile.
>
> Chances are good, that a prerelease of Emacs 24.1 works for you out-of-the-box.

I looked at the bug reports, but they seem to be cases where people 
__wanted__ binary mode.  I have the opposite issue.  I always want ASCII 
mode so ftp will do the EBCDIC <-> ASCII conversion.

I'm running 23.1.1.  I won't risk a pre-release when I have a source 
code hack that works.  I'll retest when 24 goes into production.





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

end of thread, other threads:[~2012-02-23 19:59 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-10 21:55 ange-ftp using binary mode Ken Goldman
2012-02-11  7:01 ` Eli Zaretskii
2012-02-15 20:17   ` Ken Goldman
2012-02-15 20:49     ` Eli Zaretskii
2012-02-15 21:25       ` Ken Goldman
2012-02-14 13:54 ` Michael Albinus
2012-02-15 19:59   ` Ken Goldman
2012-02-15 21:30 ` Ken Goldman
2012-02-16 10:42   ` Michael Albinus
2012-02-23 19:59     ` Ken Goldman

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