Suppose a script a.pl uses a directory 'xyz' to create certain files say 'a.log' and 'b.log' in it and write to them.
While if a.pl is running, if a copy of a.pl is fired some other location which utilizes the same directory 'xyz' to create the a.log and b.log files then, my requirement is that the copy of a.pl should not be able to access dir 'xyz'and should exit.
Suggest a solution to lock the directory while in use and also to check whether its locked.
1. Its not possible to use two different directories for different instances of run . (as a part of requirement).