>>> Will "tail -f /dev/random" actually work? My understanding is that since
>>> it tries to go to the last N lines of the file, which don't really 
>>> exist, it won't ever show anything.

> Hmm. I tried it before I sent that and didn't get anything back.
> Cat'ing  it worked though. What am I doing wrong?

tail, even with the -f, tries to seek to the end of the file first.  If 
you examine the source, you'll see that if it's not reading from a 
regular file (i.e., it's reading from a device special file, which
/dev/random is), it sets up a circular buffer and reads into that, 
maintaining enough of a buffer to be able to display the last n lines 
of the file (where n is passed to tail as an argument or defaults to 
10).  When it hits the end of the file (which it never does, when 
reading from /dev/random, since the read blocks until there is more 
entropy and then returns when there is some), it then displays the 
contents of the buffer and goes into it's end-of-file watching mode.

cat, on the other hand, just opens it up and reads until it hits end of 
file, which it never does.

        -jan-
-- 
Jan L. Peterson
Peterson Technologies
<[EMAIL PROTECTED]>



____________________
BYU Unix Users Group 
http://uug.byu.edu/ 
___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list

Reply via email to