Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: For engine authors, end-of-file on input

Author: Sune Fischer

Date: 02:31:33 04/14/04

Go up one level in this thread


On April 13, 2004 at 07:08:19, Fabien Letouzey wrote:

>
>Hello,
>
>I have a request for all engine authors.  Please let the engine quit
>when end-of-file is read on input.  This applies to xboard, UCI and
>even console engines.
>
>I know the engine is supposed to receive "quit" first in both xboard
>and UCI, but the interface (whether graphical or not) might crash or
>get killed or whatever.  If end-of-file is received, how are you going
>to get new commands???
>
>I guess most engines use fgets() to read input, just test the return
>value for NULL.  Technically is could be an error or end-of-file then,
>you can use ferror() and feof() if you wish to distinguish.  If you
>use read() or the like then 0 means EOF was reached.

Testing for NULL doesn't seem to work, it still hangs when the GUI crashes.

Perhaps I'm doing it wrong, should it be if (stdin==NULL)?

-S.



This page took 0.01 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.