[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [MiNT] Here documents and CRLF
> From: Andreas Schwab [mailto:schwab@issan.cs.uni-dortmund.de]
> Sent: Friday, June 18, 1999 10:53 AM
> To: reschke@muenster.de
> Cc: Guido Flohr; MiNT mailing list
> Subject: Re: [MiNT] Here documents and CRLF
>
>
> "Julian Reschke" <reschke@muenster.de> writes:
>
> |> Keep in mind that the standard line delimiter for TOS systems can't be
> |> changed just by saying "we want it the UNIX way". There are
> lots of sources
> |> of text information on a TOS system, and except for some ports
> of UNIX tools
> |> these files always will have CR/LF (not to speak of text files that you
> |> might have copied from -- gasp -- a DOS/Windows system).
>
> But if you set 'b' in UNIXMODE you tell MiNTlib that your system is POSIX
> compliant in this area, so your get what you deserve if it is not.
>
> If all you care is POSIX then "r" and "rb" are one and the same.
However then stdin and stdout are treated as binary, which they aren't (in
most cases). If the right open mode is specified everywhere, and if MiNT lib
support both LF and CR/LF for text streams (which it should), then there
wouldn't be any need for UNIXMODE at all.
Note: ANSI defines that stdin/stdout/stderr are text streans. If you need
them as binary strings, the only portable way is to use fdopen (handle,
mode).
Regards, jr