Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: how to tell if a file is still being modified

by PhilHibbs (Hermit)
on Sep 16, 2003 at 10:47 UTC ( #291782=note: print w/replies, xml ) Need Help??


in reply to Re: how to tell if a file is still being modified
in thread how to tell if a file is still being modified

As there is no reliable cross-platform file locking system, flag files are a common pattern for indicating process state. I worked with a system that had directories called "do", "done", "pending", "success", and "fail". The actual data file was dropped in the "pending" directory, then a file of the same name was created in the "do" directory. When the file transfer subsystem had done the transfer, it moved the "pending" file to "success", and moved the marker file from "do" to "done".

Can you get the sending process to create a marker file (either with an extension, a prefix, or in another directory) to indicate completion, and monitor for the marker instead?

  • Comment on Re^2: how to tell if a file is still being modified

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://291782]
help
Chatterbox?
[1nickt]: thezip use Path::Tiny. @paths = path("/foo")-> children; (Excludes "." and ".." automatically.)
[1nickt]: (Also takes a compiled regexp as an arg to filter the list)
[1nickt]: For multiple dirs use iterator(): $it = path("/foo")-> iterator; while ( my $path = $it->() ) {...}
[1nickt]: (also skips . and .. automatically, and follows subdirs if you set <c\>recurse => 1</c>

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2017-03-28 18:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (339 votes). Check out past polls.