Earlier quoted context omitted.
> because the handle is independent of the path. This makes me wonder, what happens [EDIT: on Windows] when a program uses a file, which more than a single hardlink points to, and you want to remove one of them. Does it matter, through which hardlink the file gets opened or are all the hardlinks prevented from being unlinked?
On Linux you can delete all hardlinks to open files. What you can't do is modify a file that's executing (program or library), then you get ETXTBSY.
> What you can't do is modify a file that's executing (program or library), then you get ETXTBSY.
Why can't you? Couldn't it do the same thing and just keep it in memory?
Edit: Actually on my system, I can start a program, unlink it and keep using it just fine. I wonder what case you are referring to.
ETXTBSY isn't even descriped in unlink(2), but it is in unlink(3posix): ETXTBSY - The entry to be unlinked is the last directory entry to a pure procedure (shared text) file that is being executed.