Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Perl process to constantly detect the time change of a file?

by stefp (Vicar)
on May 04, 2002 at 02:31 UTC ( [id://163961]=note: print w/replies, xml ) Need Help??


in reply to Perl process to constantly detect the time change of a file?

May be you want first to check out packages that do similar stuff like File::Tail, File::MultiTail and even POE::Wheel::FollowTail if you want to insert you stuff in an event framework. Even when I don't use a package or don't borrow code from it, I sometimes notice they deal with issues I had overlooked.

-- stefp -- check out TeXmacs wiki

  • Comment on Re: Perl process to constantly detect the time change of a file?

Replies are listed 'Best First'.
Re: Re: Perl process to constantly detect the time change of a file?
by abstracts (Hermit) on May 04, 2002 at 08:19 UTC
    I think this is an excellent advice as it looks at the problem from a different perspective. Instead of polling the time the file was last changed, you wait for the file to change. (this of course assumes you can read from the file)

    ++stefp++

    Update: Actually, coming to read the original post again, this will not work if the file is "touched" by another process, only if appended to. Nonetheless, --stefp++ :-)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (2)
As of 2025-05-21 02:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.