Thanks for the update. I could only generate a lock file if the file is created by swriter - if the text file already exists it does not generate a lock file (no idea why). However, that still did not generate your symptoms. I can exactly reproduce your problem by making the file read-only. Could it be that this is nothing to do with locking but simply that you do not have write/append permissions?
By the way, $? has nothing to do with this issue. That is the exit status of the previous child process and, so far as I can tell, you are not running any. | [reply] |