Path: utzoo!news-server.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!agate!fugitive.berkeley.edu!izumi From: izumi@fugitive.berkeley.edu (Izumi Ohzawa) Newsgroups: comp.sys.next Subject: Re: Files created on IBM clones Message-ID: <1991Mar11.200319.8207@agate.berkeley.edu> Date: 11 Mar 91 20:03:19 GMT References: <1991Mar11.155026.3504@ux1.cso.uiuc.edu> Sender: usenet@agate.berkeley.edu (USENET Administrator) Organization: /etc/organization Lines: 35 In article <1991Mar11.155026.3504@ux1.cso.uiuc.edu> ceblair@ux1.cso.uiuc.edu (Charles Blair) writes: > > I created a C program using the editor supplied by Turbo C 2.0 on >an IBM clone, copied this to a diskette, then read it into the NeXt. >Something went wrong somewhere along the way. The file seemed to be >missing the last line and had what seemed to be invisible characters >which were also messing things up. The file also looked a little >different when I looked at it using (1) ed called from Terminal >(2) Write Now. You are looking at possibly two things. One is a CR (0x0A) char at the end of each line, and the other is a CTL-Z character at the end of the file. Unix (NeXT) text files use LF (0x0D) as the end-of-line marker, while MSDOS uses CR LF pair to indicate the same. You will see CR char as "^M" in 'vi'. CTL-Z is no longer needed for MSDOS, but a lot of editors still put it in at the end of the file. I know that cc on NeXT chokes on CTL-Z char, and may be other things too. Write a filter program which removes all control characters with the exception of LF, TAB, FF. It's a 5-line program. And process all files imported from MS-DOS platforms. Does /NextApps/Edit have an option of displaying control characters in a text file? That is sourly needed to see this kind of problems with text files. -- Izumi Ohzawa [ $@Bg_78^=;(J ] USMail: University of California, 360 Minor Hall, Berkeley, CA 94720 Telephone: (415) 642-6440 Fax: (415) 642-3323 Internet: izumi@violet.berkeley.edu NeXTmail: izumi@pinoko.berkeley.edu