I am trying to debug a problem where users occasionally have locked files which they try to open. The code appears to have correct exception handling but users are still report
try this:
( >&2 pause ) >> yourfile.txt
>> opens yourfile.txt in append mode
>>
yourfile.txt
see this for a reference