Even on Linux there's lsof
, so this shouldn't be a problem.
Also, another problem with keeping files around if a process has them open is that disk space doesn't get freed. Particularly annoying if you have a VPS with a tiny amount of disk space and you want to delete e.g. a bloated log file, only to find disk usage isn't going down. (lsof
helps with resolving such cases too).
(IMO the right thing to do would be to allow deleting the file at any time, but return an error to whatever processes have it open and try to perform I/O on it instead of keeping it around)