View Single Post

  #4 (permalink)  
Old 05-12-2007, 03:10 AM
NVRAM NVRAM is offline
Junior Member
User
 
Join Date: May 2007
Posts: 8
Rep Power: 0
NVRAM is on a distinguished road
Default

Quote:
Originally Posted by nixcraft View Post
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.
Reply With Quote