[svlug] select/poll and EOF

M. Drew Streib dtype at dtype.org
Thu Aug 14 22:28:14 PDT 2003


On Thu, Aug 14, 2003 at 10:18:12PM -0700, Scott Hess wrote:
> Does it need to be a real file, or similar to a file?  If you can live
> with a named pipe (aka fifo), then select() should work.  mknod(1) to
> create (or mknod(2), of course), then open for reading and run your
> select() loop as normal, and have the other side write to it.

Unfortunately, the writing process is recording the session independently
of any reading processes, so a fifo may be out.

In particular, the current implementation is at http://dtype.org/nethack,
or just telnet to nethack.alt.org and (w)atch games in progress.
The tty playback engine is pretty cool now, and allows you to view tty
sessions in progress (nethack games), but is doing so now at a 1/4
second read() loop. I can't help but think there must be some way
to block on data available to read somehow...

I thought about using a fifo and a 'cat' process, but 'cat' ends at
eof. I could 'tail' into a fifo, but tail also uses a cheese method
of only read()ing at certain intervals.

Since the writing process is sort of independent, and the write/read
isn't 1to1, I think fifo isn't my solution. :/ 

Thanks though. Any further thoughts?

-drew

-- 
M. Drew Streib <dtype at dtype.org>
Independent Rambler, Software/Standards/Freedom/Law -- http://dtype.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.svlug.org/archives/svlug/attachments/20030815/7ac0f116/attachment.bin


More information about the svlug mailing list