#Keeping <CR><LF>'s ??
15 messages in this thread
I've got a question about doing serial communications on the Amiga. I'm
writing a simple terminal program and have noticed that when I do ASCII
file transfers on the Amiga, all <CR><LF>'s are converted so that only the
<LF> remains (please…someone correct me if I'm wrong on this). Is there
any way that I can tell the system that I DON'T want that translation to
happen?? The application is very checksum depandant, and it involves a file
that is modified several times on the Amiga, but the changes to the file
are shipped to a host computer (which uses <CR><LF> as a line terminator).
After the Amiga gets the file and strips the <CR> my checksum is off
<sigh>.
There's nothing in the Amiga's serial device that strips the CR
part of a CR/LF combo. That part is handled either by the terminal
program, or the BBS you're connected to (or other computer's terminal
software).
My program is not doing anything to strip <CR>'s off the end. All I know is
that when I look at the file on the host computer, they are there and when
they reach my buffer they are gone. Isn't the Amiga's default EOL character
a <LF> instead of a <CR><LF>? It seems to me that I read that somewhere a
while back.
John,
Yes, the Amiga's default EOL is a LF, but the Amiga itself does no
character stripping. Not the serial device, nor the filesystem. Thus, the
only way the CR could have been stripped is if either the sending program
stripped it, or the receiving program stripped it.
Many terminal emulators have the option of converting output text
(and padding input text). Make sure the sending program is doing no
translation.
Don
Aaaaahhhh (as the light bulb pops on <g>)! Ok, I see it now. I'll check the
host system to see what it's up to, and I'll also take a look at my output
processing (since I think this is where the <CR>'s get lost).
Thanks for all the help!! One of these days I'll be able to program this
beastie! Then maybe I can start writing the more serious software that is
on my agenda.
Thanks again,
John
John,
You also mentioned that the file was edited or altered on the Amiga
before sending it back to the PC… the CRs may be being stripped off by
whatever means you are using to alter the file before returning it.
Just a thought…
Keith
Keith,
The file is edited using MEMACS, and I've been very careful not to change
any of the ugly "^M"'s that I see <g>! I have the part of getting the file
from the host ok. But my latest attempt to make sure all <LF>'s have a
matching <CR> for the end of line brought a visit from Mr. Guru!! All I'm
really trying to do is use B protocol and automate my editing process. I
was using Access! for the file transfer part, but I had to keep switching
in and out of the Access! screen to do my editing part. However, using
Access!, the editing process worked fine and I could make multiple updates
with no problems. Does Access! do anything special in the way of B protocol
or the serial I/O to keep <CR>'s?? This is really beginning to drive me up
a wall <g>! I'm so close, and I'm sure I'm just doing something dumb or
missing the obvious here.
Thanks,
John
Hmmmm… I'd have to look into that further, but off-hand, I don't believe
that B protocol strips CRs during a transfers. Are you downloading and
uploading with B protocol, or are you doing an ascii capture/send for one
of the directions ?
Keith
Keith,
I'm downloading the original file, modifying it, and then upload the
changes that were made. All of it happens under B-Protocol.
John
Hmmm… I don't see where B protocol should be changing anything. You might
try double-checking the file (maybe a hex dump of it) before sending it to
see if the editor left the CRs in. If I come up with anything else, I'll
let you know.
Keith
Keith,
I'll check it out. I really HOPE it does, or it looks like it will be time
for me to write an editor too <groan>!!
John
John,
If you choose Access!'s System/End-of-Line menu item and change both to
CR/LF, I expect your problems will disappear.
Malcolm
Malcolm,
Thanks for the reply. Actually, I'm not having ANY problems with Access!,
but with a terminal package that I slapped together. I don't think I'm
doing any character stripping, but they're gone nontheless.
John
Simply tell your terminal program you're transfering a BINARY file. It
should not muck with it.
Thanks! I'll try using that route!!