- cross-posted to:
- programmerhumor@lemmy.ml
In case anyone is interested, there’s a powertoy called file locksmith that will show what’s using it and let you kill it: https://learn.microsoft.com/en-us/windows/powertoys/file-locksmith
“Time to see who’s stopping me from deleting this file… svchost??? Goddamn it!”
The performance view thing that comes with windows also allows searching for file handles but it’s not very user friendly. Also not possible without admin rights if I remember correctly
Me: I’ve closed the program, now please delete the file
Windows: ok, give me half an hour, it’s not easy to delete 500 MB
Here’s an incredibly animated chart of how poorly I’m doing. Note that I seem to throttle the operation every 5 seconds or so.
Explanation? No, no. Haha. No. We don’t do anything like that.
… And the file is back open somehow. Only now the program throws an error when Windows launches, yet still leeches resources.
Hey Linux, sudo rm -rf /
sigh I’m surrounded by idiots.
“Sure thing boss” you fucking moron.
Missed the flag
--no-preserve-rootor you could just add a wildcard.Great point.
“Hey Linux, can you just delete this file please?”
“Sure thing bud, a program is using it, it’s ok, I will just unlink the inode anyway, the program can still access it until it closes the file”
This is honestly one of my favorite features of the linux filesystem. As a dev it makes things like replacing and hot-reloading plugins way easier.
It turns out you can kind of get the same functionality on Windows if you rename the open file and place the new one with the original name, but it’s a bit of a hack.
Windows won’t let you rename a file that’s being used either.
Yeah, super annoying. In Linux you can rename or move it and the app using it doesn’t care.
Although having the option of listing the app using a file so I can kill the app would also be really nice to have. I’m sure Linux has something for that too, but I don’t know what it is.
I’m sure Linux has something for that too, but I don’t know what it is
fuser
I can’t remember the other program that’ll do it.
But there’s another one that’ll list all the processes using a file.
Tip of my tongue fuck.
lsof | grep <filename>
TBF the task manager and those windows explorer dialogues were programed in like 1996 and it’s probably one of the best functioning feature in Windows so changing it too much carries high risks.
changing it too much carries high risks
This is such a Windows way of thinking. Why does every other OS constantly change and evolve but Windows is like “can’t touch this code from a quarter century ago?”
I don’t see the problem with it. Microsoft historically does a great job of making everything worse with updates.






