On 02/15/2010 09:22 AM, Tim Moore wrote:

>> Hint:  The sleep statement ensures that the reader (fgfs)
>> will not see an EoF at the point where one cat of bytes
>> ends and the next begins.

> I'd probably do without the "sleep" and write while true; do cat bytes;
> done >/tmp/pipe.flog & instead.

1) That doesn't work at the moment (but see below!).
The problem is that when the first cat completes,
the reader (fgfs) gets and EoF, and that's the end 
of the show.

========

> It's good that you've removed the lseek from the usual path through
> readline. 

:-)

> But, as I said, your patch breaks a useful command-line option. It
> would be no big deal to insert an lseek to the beginning of the file in your
> new readline; if the file descriptor doesn't support lseek, then no harm
> done.


2) It would be even less of a problem to do the following
the specified number of times:
  -- detect the EoF
  -- close the file
  -- reopen the file and start reading again.

This has the advantage that it works the same as lseek
for regular disk files, and works a whole lot better
for FIFO files.

It also removes the need for the "sleep" and simplifies
scenario in item (1) above.

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to