Allow multiple instances to read from the same image
A Windows tool for writing images to USB sticks or SD/CF cards
Brought to you by:
gruemaster,
tuxinator2009
yes you should remove the file lock, my computers has 4 usb ports and I can only write with one at a time, what a waste
Unfortunately, I have to put a lock on it otherwise Windows will be updating the filesystem as I am trying to read from the raw device (and Windows won't allow that). It would be like trying to read a file as you are formatting the media the file is sitting on.
This is more of a Windows limitation, not an app limitation.
The other part of this is that the mechanism to read from an image file vs a raw device is not separate code. The program passes a file handle to the read function. That handle can be either a file or a device. Even reading a file, the OS updates it (last access time). As we are doing a continuously streaming read/write (or verify), we need to ensure that the file doesn't change (hence the lock). If not locked, there is nothing to stop the user or the OS from changing/deleting the file while it is being read. This causes at a minimum stale file handles which are a PITA to clear up. Worst case is that the image will become corrupted mid write, or the filesystem that the file is sitting on could become dirty (requiring Windows to run a checkdisk to fix during reboot).
While I hate to use this term, this is the 'simpler' way to do it.
Last edit: Tobin Davis 2019-03-28