Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: file state mannagment

by Eyck (Priest)
on Feb 05, 2009 at 13:17 UTC ( #741540=note: print w/ replies, xml ) Need Help??


in reply to file state mannagment

You do it like this:

foreach $log (@logfiles) { rename($log,$log.".tmp"); ProcessLogfile($log.".tmp"); } foreach $log (@logfiles) { del($log.".tmp"); };
this way, everything that is logging, will keep on logging into it's open filedescriptor (ie - the new data will go into .tmp file).

The problem is - how long are your external logging processing keeping their logfile descriptors open, the key part being - are they keeping their descriptors opened indefinitely? Then you're out of luck and can't really do what you're trying to achieve.

If their logging method is

open(LOG,">>logfile"); print LOG "memo"; close LOG;
then the method described above would work OK.


Comment on Re: file state mannagment
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2014-07-11 23:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (236 votes), past polls