Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Cron Job??

by diskcrash (Hermit)
on Apr 04, 2001 at 00:58 UTC ( #69475=note: print w/ replies, xml ) Need Help??


in reply to Cron Job??

kschwab makes a very good point. How do you know when the transfer is done? I used the following to see if the file was modified at least ten seconds ago (Hopefully avoiding a race condition):

$getinfile=$indir.$infile; ($device,$inode,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctim +e, $blksize,$blocks) = stat($getinfile); my($timenow)=time; $delta=$timenow-$mtime; if ($delta < 10) #***file too young, wait a few seconds { next; #***jump to the end of the loop }

I haven't actually seen a race condition, but, like kschwab, worried about it. I would take advice on any (more coherent) means of assuring a file was closed.

-Diskcrash


Comment on Re: Cron Job??
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (10)
As of 2014-09-22 19:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (198 votes), past polls