Meanwhile on Linux: /boot successfully deleted
Programmer Humor
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
I once deleted /dev/null Do not recommend. Youโd be surprised how much of the system needs it.
How? I could've sworn it wasn't even a "real" file. I thought the file system just had special rules for interacting with that name.
I once deleted /dev/urandom. I didn't want uncertainty in my life.
Well, I was on for a surprise.
well, i guess your pc got into a pretty certain state of being, at least for that evening, so technically it worked:)
"Hey Microsoft, i want to safely remove this hard drive so i don't corrupt my data"
"Nope, it's being used by another program"
"I shut down every program, nothing is open, please eject my Hard drive"
"Nope, It's being used by another program"
**Proceed to just yank the cord out of the computer and flick off the screen.
Well duh, Microsoft respects privacy
Process explorer, threads and handles tool, search the file name.
Kill the process or at least you know who now.
Actually on windows 7 I found out how to get which process is locking one file.
You open the resources manager (task manager has a link to it)
Inside you can see how much each process uses on cpu, network and stuff.
And there is a tab where all used files for each process is listed. You can search for specific files.
Yeah there's a Microsoft sysinternals utility where you can drag a file into to fetch that info for you.
Makes zero sense there isn't a >Details in the error notification that tells you the damned process in Windows.
Right? I get that it's "alarming" to users to see weird stuff, but just hide it under a little expandable thing.
Not only that, but you can actually search all active processes to see which handles they keep references to. Just search the name of your file and it will show you the processes which use it
Gawd forbid users get some transparency.
"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"
Hmm. So are the blocks freed up for overwriting on file close, then?
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.
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.
Only if you don't have OneDrive working. In that case, you have to wait for it to sync or it won't go through.
Anytime I have an issue at work where I can't change or delete a file, it's a 50/50 split between Excel and OneDrive being the cause
back in the XP days, I used a software called "Unlocker" just for this problem. It probably still exists, I don't know, because since Windows 7, the easiest way to find out what process locks a file is to open Resource Monitor (Start search: resmon) and on the CPU tab, using the "Associated handles" list, you can search for the file name and see the process in question (and kill it).
So yeah, Resource Monitor is a useful tool on Windows.
The bugs and horribly slow hardware that caused the locks in NT/XP have slowly disappeared, by win 10, I rarely had any files I couldn't delete if I, worst case, made explorer reload. It used to happent o be every other day in the late 90s
There's a collection of free little utilities called Microsoft PowerToys, including the file unlocker thing. Why would they not include these into base kit Windows is beyond me.