I have a Node.js script that is running in a while (true) fashion and watches directories for certain files and removes them using unlink API:
fs.unlinkSync(path);
The files are not created by Node process, but as POSIX documentation about unlink says, files are not removed from disk until process is closed, thus lsof will list them as (deleted) and tied to node process.
My script is some kind of a "watchdog", so how would I go to removing those files and cleaning up disk space without restarting the Node process itself?
Thanks!