4 ms·
What's wrong with a file being used by another process ?
by hulitu 5y ago
What's wrong with a file being used by another process ?
- Woodi 5y agoIt can be very bad eg. when file is a database ;) - so here we are circularity in use-cases :)
- pjmlp 5y agoAll sorts of data corruption possibilities. Even after UNIX finally added support for file locking, its use relies on all processes making use of the API, if they don't care, they get to access the file anyway. What angers UNIX users about file locking on Windows, is actually how proper file locking is done outside of UNIX, Windows is not alone in that regard.
- feffe 5y agoAs a self identifying Unix user, what angers me about file locking on windows is that I can't delete a file that another process has opened. This often leads to the situation that I can't delete a large directory structure because some unknown program has a file open in said directory. I don't care, just let me delete the directory please! Maybe it's not a "Unix" design, but something done by Linux. The concept that a program can continue using an already opened file while to others it's deleted is quite elegant.
- avidphantasm 5y agoThis times 1000. Windows’s pessimistic file locking is why even trivial system updates require a reboot. Makes my blood boil every time.
- pjmlp 5y agoMostly because the people writing those updates don't update themselves (pun intended). https://docs.microsoft.com/en-us/windows/win32/rstmgr/restart-manager-portal https://docs.microsoft.com/en-us/windows/win32/rstmgr/restar...
- pjmlp 5y agoIt is elegant until it happens to be an important file now lost forever on process shutdown, and yes it is pretty much UNIX. A very basic attack vector, to yank files used by other processes and not take place in the traditional lock file dance.