Quote:
Originally Posted by nixcraft
|
The open-file-descriptor gotcha is one I've seen lots of users trip over with daemons that would grow their log files without bound. This page expains it pretty well, but...
It is a bit misleading since on most systems "vi" does not keep the file opened, if you see the expected differences then I'd be surprised. A better example would be to run:
sleep 120 < /home/user/demo.txt &
instead of vi on another terminal/console. Then remove, check usages, kill the job, then check again.
Cheers.
PS: On many/most Linux systems with a "/proc" filesystem, you can find open, deleted files with:
ls -l /proc/[0-9]*/fd | grep ' (deleted)$'
PPS: Presuming you have permissions, you can often access the file by that symbolic link; use 'wc' to determine the size or even copy the contents back to a disk file.