in reply to Re^2: how can i find whether a file has been opened by some other process across a network(not in a single machine)?
in thread how can i find whether a file has been opened by some other process across a network(not in a single machine)?

It might be worthwhile mentioning why you need to check if a file is already open, and what exactly you mean by that. For instance, if a program has opened a given file with an advisory flock and expects mutual flocking your script can still read/write it's contents, even if that will perhaps lead to unpredictable results. It all comes down to what you are trying to achieve.

Sometimes, the solution to a problem comes along easier if the whole picture is presented. It's like a painting. You are showing us a tree, and we say "nice". But you never mention about the beautiful lake right beside it, which makes us go "wow". ;)

  • Comment on Re^3: how can i find whether a file has been opened by some other process across a network(not in a single machine)?
  • Select or Download Code

Replies are listed 'Best First'.
Re^4: how can i find whether a file has been opened by some other process across a network(not in a single machine)?
by Anonymous Monk on Dec 05, 2005 at 13:08 UTC
    Here's a scenario I have a configuration file, say config.txt. which actually gets updated by one of my programs, say update_config.pl. Now, a user can open the file and see the content of the file, config.txt while somebody else is using the update_config.pl program. Now, if the user who had kept the config.txt file opened saves while closing te file, the change made by the update_config.pl is lost. I want to avoind this situation. I hope i've painted the picture of my lake to your liking :)