Remix.run Logo
Chu4eeno 3 hours ago

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.

1718627440 3 hours ago | parent [-]

My question was about Windows, yeah on Linux it obviously doesn't matter, because you can unlink it even if there is only a single hardlink. My bad, I should have written it.

> 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.