Nyimi Jose ) wrote:
Gunnar Hjalmarsson wrote:
Shu Hung wrote:
I am writing a script to relocate some tar files in a folder.
Since those tar files are scheduled to be written daily, I want
to make sure I'm not moving any files which are being written
by other programs...
How can I do so?
You can lock them.
perldoc -f flock
perldoc -q "lock a file"
It seems that (from original post) there are 2 programs there:
Program1: writing the tar files
Program2: trying to relocate tar files created by program1
My understanding is that the "lock" should be done by the program1
to avoid program2 relocate files untill it (program1) finishs
writting them.
If the program1 is not under your control, how to use the "lock"
solution you suggested ?
You can't. Locking must be done by the "other programs" (which I
assumed the OP is able to modify...).
Thanks for pointing it out.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>