in reply to Lock on file

Aside from the missing use Fcntl, locking with flock is just advisory. Stuff that doesn't attempt to flock won't be stopped from modifying the file in any way.

Replies are listed 'Best First'.
Re^2: Lock on file
by Anonymous Monk on Feb 10, 2006 at 15:44 UTC
    Thanks, it now works.
    From your inputs it sounds like I should not use any kind of Flock and just do the copy?

    If I was copying a small Access database the Flock would be needed? And if so what kind?

      It's highly unlikely Access is going to honor flock, but you're definitely welcome to try. And if it doesn't then you don't really gain anything by trying to lock it as it's free to ignore it, hence "advisory locking".

      Think of it as a "Wet Paint" sign on a bench. The sign itself just tells you, "Hey, sit here and you're going to get covered in paint." You're not prevented from sitting and getting paint on your tuckus, but if you ignore the advisory bad things can happen. Access, more than likely, is going to blithely sit on your freshly painted bench.