in reply to Reopen file when contents changed?
You may simply want seek. I'm not really sure if it is well suited for that particular file, which may not be the case. It' worth trying in any case.
Incidentally under *NIX there's not strictly speaking anything like "text mode".
Update: I didn't want to test this myself, but in the end I did and it seems to work just fine:
#!/usr/bin/perl use strict; use warnings; open my $fh, '<', '/proc/stat' or die $!; { print scalar <$fh>; seek $fh, 0, 0; sleep 1; redo; } __END__
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Reopen file when contents changed?
by dReKurCe (Scribe) on Jun 07, 2005 at 21:15 UTC |
In Section
Seekers of Perl Wisdom