Next | Trivial Utilities | 40 |
There's an interesting special case here
How does the file get opened in the first place?
Initially, $devino is empty
my ($dev, $ino) = stat $file; if (defined $dev && "$dev,$ino" ne $devino) { while (read F, my($buf), 8192) { print $buf; } open F, "<", $file or die "Couldn't open file $file: $!; aborting"; $devino = "$dev,$ino"; seek F, 0, 2 if $END; $END=0; }
So the if test succeeds and file gets opened
The first time this happens, the seek moves the handle to the end of the file...
...if the -e flag was supplied
ftail -e starts at the end of the current file
Next | Menu | Copyright © 2012 M. J. Dominus |