Your method can not assure that A further system on the computer hasn't modified the file. It truly is what Eric Lippert refers to as an exogenous exception. You cannot stay clear of it by checking to the file's existence beforehand.This can make it extremely important the lock is produced from the Keeping thread when it is completed with it. If it