On Mon, Feb 15, 2010 at 2:41 PM, John Denker <j...@av8n.com> wrote:

> On 02/15/2010 03:19 AM, Tim Moore wrote:
>
> > Some of
> > the grossness is due to a hack which lets a file be treated as an
> infinitely
> > repeating stream of bytes, very convenient for demos at SIGGRAPH. Your
> patch
> > breaks that hack. I won't argue too strongly that the hack belongs in
> > SGFile, but I want to have some story for replacing it, possibly in
> > FGGeneric::process(), before we blow it away.
>
> Please try this story:
>
>   mkfifo /tmp/pipe.flog
>   sleep 1000000 > /tmp/pipe.flog &
>   while true ; do cat bytes > /tmp/pipe.flog ; done &
>   fgfs --generic=file,in,$rate,/tmp/pipe.flog,$protocol
>
> One good hack deserves another. How do you do that on Windows?

> Now that readline does not do seeks, it can read named
> pipes (FIFOs) just fine, and this opens up all sorts of
> non-hackish way of solving the SIGGRAPH problem ... and
> a host of previously-unsolved problems as well.  For
> example, it allows you to switch from one stream of
> bytes to another without restarting fgfs.
>
> Seems like a win/win to me.
>

> If this story is not good enough, please clarify the
> question.
>
> 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. Or you could do something different in FGGeneric. In any case I'm not
going to check in this in until that problem is addressed. If don't feel
like doing that, perhaps I'll do it myself.

> ============
>
> 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.

Tim
------------------------------------------------------------------------------
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