File Locker

Hold a file in exclusive-share mode.

For developers debugging "the file is in use" code paths.

A debugger's tool: open any file in fmShareExclusive mode so no other application can read or write it. Useful when you need to reproduce a file-in-use error path that your own program has to handle.

What it does

You point File Locker at any file on disk. It opens a stream on that file in exclusive-share mode and keeps it open until you close the program. Any other application that tries to read, write, or delete that file will fail with a sharing violation.

When you need it

  • Testing your own program's behaviour when a file is unexpectedly locked
  • Reproducing a customer's "file is in use" bug report in a controlled way
  • Verifying retry-on-locked logic with deterministic locking
  • Forcing other apps to wait, fall back, or surface a clear error message

Features

  • Single executable — portable, no installer
  • One file at a time
  • Lock released the instant you close the program
  • Useful in combination with debugger breakpoints

System requirements

  • Windows 7, 8, 10, 11
  • A few MB of free RAM
  • Under 1 MB of disk space

Browse the full catalog

49 small, sharp Windows utilities. All freeware. All by the same author.