Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: new autoplayer interface standard

Author: David Eppstein

Date: 13:32:14 09/17/98

Go up one level in this thread


On September 17, 1998 at 14:58:50, Don Dailey wrote:
>If windows/dos is not that flexible, then it is probably better to
>conform to the lowest common denominator and use the dos style,
>a unix program will bring in a dos line with no problem and sending
>out dos-like output is trivial.
>
>Of course I don't really know how mac's deal with all of this.

Mac text files are generally stored with lines separated by CR only.

But, it's more complicated than that.  In order to preserve Unix source code
compatibility, the C compilers I've used default to a weird I/O mode in which
CRs are automatically translated to LFs and vice versa -- so when talking to
stream input or output one usually uses Unix conventions.  But when talking to
Mac graphical user interface widgets, one must use the Mac convention.
It's all very confusing... on top of that some text editors allow you to save
your text files in whichever of the three conventions you like.
And of course if you copy a file from a different kind of machine, it may or may
not get translated...

The "defensive programming" response to this mess is to handle CR, LF, CRLF, or
maybe even LFCR, all as being equally valid line delimiters.



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.