3 ms·
The content of the file remains accessible to the process that has it open and continues to take up disk space. ... and a new file with the same name (and path
by joey_spaztard 23d ago
The content of the file remains accessible to the process that has it open and continues to take up disk space.
... and a new file with the same name (and path) and different content can be created that exists at the same time.
This can be confusing.
"I'v updated that file on the server and it has not taken effect. I'v ssh'ed in and I can see the new version. What is going on? If I reboot that box the phone will start ringing..."
- dlcarrier 23d agoI've had the opposite problem, where I assumed shell scripts were cached, but an instance already running started using my modified version, while I was still working on it
- ButlerianJihad 23d agoI can testify that it's bonkers when a shell script is overwritten in place, and the interpreter bombs out with an irreproducible error message, because the contents shifted around that much. Or I suppose it would be even worse if the script silently continued to execute after that same trauma. Also, let's not limit our scenarios to one process and one file descriptor. Each of those is a reference count. So your process may open the same file 3 times. And/or 10 processes on the system may hold the file open. 30 file descriptors might as well be 30 hardlinks in the filesystem. The file has life until all of those references go away.