4 ms·
Why not? Once a process is started I'd be very surprised if you couldn't delete the executable from the disk.
by jhardy54 6y ago
Why not? Once a process is started I'd be very surprised if you couldn't delete the executable from the disk.
- bitwize 6y agoWindows file systems work very differently from Linux. If a file is open, Windows will put a lock on it that prevents moving or deleting the file -- and the executable image of a process is open for as long as the process runs. This is different from the Linux situation, in which a file's name and directory location are separate from its inode, or the data structure holding actual information about the file including where the data lives on disk: once the inode associated with a file name is looked up and the file opened, anything may be done with the file name, including changing or unlinking it. Inodes with no links will also only be freed once every open file descriptor on the unlinked inode is closed. So a process will keep on chugging even if its executable file on disk is deleted, as though nothing happened -- because the file itself is only deleted once its inode is closed and unlinked.