3 ms·
Can someone with knowledge of the underlying OS mechanisms answer this for me: What is the deal with file access on Windows? The Windows locking defaults when
by trezor 18y ago
Can someone with knowledge of the underlying OS mechanisms answer this for me: What is the deal with file access on Windows?
The Windows locking defaults when opening file-handles actually includes locking and has done so for such a long time that applications have come to depend on it.
If you check the Win32 API you will see applications have several options for requesting (or not requesting) file-locks when doing file-operations, but not using them, the defaults are to play it safe and ensure that no data is lost due to improper access.
Technologically speaking, this is kinda the same as you have in Linux, except that the defaults are the polar opposite.
Changing the defaults now would break havoc among multiple applications relying on the defaults and cause massive amounts of corrupted data. So Microsoft have kept them as is.
IOW: If you are having issues with file-locking, you need to blame the application-developer for not properly signalling what level and type of locking is actually required, because Windows will respect the locks set on file-handles. Maybe I'm the exception, but I consider that a good thing.