On Thu, Apr 3, 2008 at 12:58 PM, Norbert Preining
On unix I can remove the current interpreter, ie I can do #!/usr/bin/perl unlink("/usr/bin/perl"); and this will succeed (if I have permissions).
On UNIX you can unlink a file while some processes (possibly the same process) has that file open. Reads, writes, &c. continue to work, except the file is no longer in the directory tree. The file's inode is only deleted when all processes close their handles to it. Other systems don't have that property—deleting an in-use file may fail (under Windows) or leave the running process in some broken state (probably some OS operates that way). On the other hand, various programs' uninstall scripts successfully delete the entire directory tree, including the uninstaller. Don't know how they do it. Hope that helped some, --Joel