I would like to lock a file, run some tests then unlock the file. How can I do this. I could use the command line, perl, or a shell script.
The reason I would like to lock the file is occasionally when connecting with
ftp to our Apache server we get an error upon deleting files: "Cannot open or remove a file containing a running program". I would like to test using an
ftp move command instead of a delete command to see if I catch this error. I would like to test whether locking a file would cause this error.