[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: dynamically generated files



On  0, Vineet Kumar <debian-user@virtual.doorstop.net> wrote:
> * Scott Henson (shenson2@wvu.edu) [020428 20:03]:
> > I need something that dynamically generates files on the file system. 
> > Much like cgi.  I need it to just happen when a program accesses the
> > file.  It will only be reading said file not executing it.  Anyone have
> > any ideas on how to do this on a woody system with ext3 fs?  Thanks
> 
> Getting more specific would help. Probably what you want is a fifo, and
> a process that continually writes to it. For example:
> 
> mkfifo /tmp/datefifo
> 
> while : 
> do
> echo `date` >> /tmp/datefifo
> done
> 
> Then, see what happens when you cat /tmp/datefifo in another console.
> (Try it a few times.)

I don't quite understand what this is doing.  What mechanism is used
to implement the fifos?  And why does this happen?

# while true ; do echo `date` >> /tmp/datefifo ; done &
# tail -f /tmp/datefifo
Mon Apr 29 17:27:23 CST 2002
Mon Apr 29 17:27:26 CST 2002
Mon Apr 29 17:27:26 CST 2002
Mon Apr 29 17:27:26 CST 2002
Mon Apr 29 17:27:26 CST 2002

and that is all I get?  And why does the gnome-terminal with the while
loop in it crash after a few more seconds?

Tom
-- 
Tom Cook
Information Technology Services, The University of Adelaide

"That you're not paranoid does not mean they're not out to get you."
	- Robert Waldner

Get my GPG public key: https://pinky.its.adelaide.edu.au/~tkcook/tom.cook-at-adelaide.edu.au

Attachment: pgpSSPXkJYDZP.pgp
Description: PGP signature


Reply to: