Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!walnut.cis.ohio-state.edu!stern From: stern@walnut.cis.ohio-state.edu (jeffrey a stern) Newsgroups: comp.sys.apple Subject: NOTE: KERMIT-65 v3.85 & BINARY FILES Message-ID: <46194@tut.cis.ohio-state.edu> Date: 2 May 89 17:58:04 GMT Sender: news@tut.cis.ohio-state.edu Reply-To: Distribution: usa Organization: Ohio State University Computer and Information Science Lines: 43 For anyone who's interested, I noticed a bug(?) in kermit, when trying to upload a binary file from my Apple //e to Suns at school using BSD4.2 UNIX. This file was a HiRes (not Double HiRes) file to be converted to Sun raster format once it got there. Using Kermit's binary file-type option, and without any terminal emulation or any other problems of the sort, I consistently lost 12 bytes from this file each time I tried to upload it. By downloading it back (this time not losing any characters) and writing a simple check program to find the differences, I found that all the bytes missing had the value 13(decimal). By chance, Kermit's End-Of-Packet (Kermit-65 is 'End-Of-Line') character is 13! Wanting to use a different End-Of-Line/End-Of-Packet character to get by this, I went through and checked for any characters under 128(dec) that by chance didn't occur in my file that I could exploit for the purpose. As it turns out, there were no 37's and no 106's. Interestingly enough, my little Apple //e and Kermit-65 let's you change the End-Of-Line character to what ever you want, (both for send and receive) but BSD4.2 doesn't! Forget Apple// vs. Mac-- let's take on the Suns!!! Finally, the only thing to do was actually change every byte of value 13 to value 37, using yet another kludge (pat on my own back, yeah!) upload the file, and then change all 37's back to 13's again. This got the file, intact onto the UNIX system at school, but I found tr and awk didn't work for this file, and sed didn't seem applicable. (Why, I'd like to know... don't they work on binary files?) Anyway, I got around this final prob' by writing a little C program using fgetc and fputc to stream the characters in and out. This problem is not mentioned in the Kermit docs. Can it be added for future use? (I couldn't use xmodem because it currently is down here at Ohio State.) I can probably put all these babies together so they work as one or two automated file editors/stream editors for this problem, and post it.... let me know if there is any interest... Jeff Stern stern@cis.ohio-state.edu --