delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/06/19/13:22:24

To: eliz AT is DOT elta DOT co DOT il
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: O_TEXT/O_BINARY grief
Date: Sun, 19 Jun 1994 09:52:42 PDT
From: "Marty Leisner" <leisner AT sdsp DOT mc DOT xerox DOT com>

In message <9406190725 DOT AA04424 AT is DOT elta DOT co DOT il>you write:
>> So why even bother?  Everything works and you have fewer
>> portability problems if you treat everything as binary...
>
>The problem is, DOS text lines have a CR-LF pair of characters as the
>end-of-line marker.  When you read such a file in BINARY mode, these character
>s
>are retained.  But programs written under Unix environment expect each line
>to end with a single Newline (aka LF, aka \n) character, so they won't work.
>

My contention is I have never seen a problem treating everything as binary.

If you have code which explicitly tests for CR-LF, then you have trouble...

I just looked at my Aztec C manuals (I used Aztec on 6502, 8085 CP/M and
Ms/Dos).   They don't know about or care about TEXT/BINARY mode...

I've shuffled hundreds of programs over the years this way between
MS-dog and Unix and I never saw anything bad happen...

marty



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019