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 reporting seeing error messages. How can I simulate a locked file so that I can debug this myself?
EDIT: For Windows.
notepad > fileToLock
from the command line (though it'll overwrite the file contents of course, but useful for simulating locks). – Vanvanadate