Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: How can I alert perl to a file write

by dingus (Friar)
on Dec 10, 2002 at 20:49 UTC ( [id://218905]=note: print w/replies, xml ) Need Help??


in reply to How can I alert perl to a file write

I think you will still have to poll something in a loop though...
How about checking the mtime attribute to stat(filename)?
# could do stat()[9] and not use File::stat use File::stat qw(:FIELDS); $cfgfile = '/my/config/variables.file'; stat($cfgfile) or die "No $cfgfile: $!"; my $last_mtime = $st_mtime; parse_config($cfgfile); #time passes #enter loop of things to do and events to check stat($cfgfile) or die "No $cfgfile: $!"; if ($last_mtime != $st_mtime) { $last_mtime = $st_mtime; parse_config($cfgfile); } # sleep(N) unless something else to do

Dingus


Enter any 47-digit prime number to continue.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://218905]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2024-04-18 20:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found