basic C question

Anthony de Boer adb-tlug-AbAJl/g/NLXk1uMJSBkQmQ at public.gmane.org
Tue Jul 13 02:14:39 UTC 2004


Henry Spencer wrote:
>  [ file unlinked but still open by a running process ]
>
> The file's directory entry is gone, but the file still exists.  It will
> cease to exist only when the descriptor is closed.  It no longer has a
> *name*, and there's no way it can acquire one, but the file itself is
> still there.  The write appears to succeed because it *did* succeed --
> the data was written successfully to the now-anonymous file.

On traditional Unix, I believe your options would be quite limited, but
I found some years ago on a Linux box on which somebody's misbegotten
log-rotation script had blown away the logfiles currently being written
by httpd, that I could copy the logs from /proc/NNNN/fd/XX, where NNNN
was httpd's pid and XX was the fd on which the log was open.

-- 
Anthony de Boer
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list