Article View: net.micro.mac
Article #6953Re: Red Ryder Kermit mode problem explained w/workaround
From: Jim Budler
Date: Wed, 27 Aug 1986 06:11
Date: Wed, 27 Aug 1986 06:11
87 lines
3824 bytes
3824 bytes
In article <1197@umd5> zben@umd5 (Ben Cranston) writes:
>It appears that the conflict between Red Ryder's "Kermit mode" and various
>mainframe Kermit programs is due to Red Ryder's implementation of only the
>so-called "image mode" of Kermit, and not the "text mode".
>
>The differance is that "image mode" transfer is strictly byte-for-byte,
>while "text mode" attempts to translate the computers' various "newline"
>schemes to a machine independant end-of-line representation on the wire.
>
>The conflict comes about because Unix uses LF (Linefeed) as a NewLine
>mark while the Macintosh uses CR (Carriage Return), and is complicated
>by the interactions that take place when one Kermit is in text mode
>and the other is in image mode.
>
>
>Fortunately there is a work-around. Before downloading a text file from
>Unix to the Macintosh, pass the file through the filter:
>
> tr '\012' '\015'
>
>which translates the LF codes to CR. Then, use the image mode on the
>Unix version of Kermit:
>
> % kermit -is <thing>
>
>and the file should end up with the proper EOL codes on the Macintosh.
>
>A similar technique can be done when uploading. Upload the file with
>the image mode set on the Unix Kermit:
>
> % kermit -ir
>
>then pass it through the filter:
>
> tr '\015' '\012'
>
>to translate the CR codes to LF to make it a kosher Unix text file.
>
>Be *SURE* to use the image mode on the Unix Kermit:
>
>If you do not use "image mode" when uploading:
>
>The Unix Kermit will be looking for machine-independant CR-LF pairs for
>newlines, and will actually EAT the bare CR codes the Mac is sending,
>and you will end up with a Unix file with no newlines at all. It is
>not possible to recover from this, as the positions of the newlines will
>have been lost forever.
>
>If you do not use "image mode" when downloading:
>
>The Unix Kermit will send CF-LF pairs for newlines, the Mac will interpret
>the CR as a newline, and the LF codes will appear as square boxes at the
>beginning of each line. Note that use of the "discard control characters"
>option on Red Ryder will probably get rid of these boxes, but will also
>get rid of any other control characters in the text.
>
>These shell scripts embody the 'tr' calls documented above, and allow an
>optional filename as argument. They have been tested on Berkeley systems.
>...
>Testing on SVR2, extension to multiple arguments, and other forms of the
>dreaded "feeping creaturism" are left as exercises for the student...
I guess I'm guilty of 'feeping creauturism'.
I do it this way, not for Red Ryder kermit, but for vanilla xmodem
transfer:
With csh:
alias lfcr 'tr "\012" "\015" < \!:1 > \!:2'
alias crlf 'tr "\015" "\012" < \!:1 > \!:2'
Use as follows:
% lfcr inputfile outpufile
% crlf inputfile outpufile
I wont pretend to guess which is better. Mine works, I'm sure his works.
I'm just presenting an alternative. The article was very well written
and informative. Thank You.
--
Jim Budler
Advanced Micro Devices, Inc.
(408) 749-5806
Usenet: {ucbvax,decwrl,ihnp4,allegra,intelca}!amdcad!jimb
Compuserve: 72415,1200
Once and for all: I like my Macintosh
Technical Details
Message-ID:
<12847@amdcad.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!seismo!lll-crg!lll-lcc!pyramid!amdahl!amdcad!jimbReferences:
<1197@umd5>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!lll-crg!lll-lcc!pyramid!amdahl!amdcad!jimb From: jimb@amdcad.UUCP (Jim Budler) Newsgroups: net.micro.mac Subject: Re: Red Ryder Kermit mode problem explained w/workaround Message-ID: <12847@amdcad.UUCP> Date: Wed, 27-Aug-86 02:11:36 EDT Article-I.D.: amdcad.12847 Posted: Wed Aug 27 02:11:36 1986 Date-Received: Wed, 27-Aug-86 11:57:13 EDT References: <1197@umd5> Reply-To: jimb@amdcad.UUCP (Jim Budler) Organization: AMD, Sunnyvale, California Lines: 87 Keywords: Kermit RedRyder workaround