watching all activity on a file?

John Abreau jabr at blu.org
Fri Dec 21 19:38:39 EST 2007



On Fri, December 21, 2007 4:54 pm, Bill McGonigle said:
>
> On Dec 21, 2007, at 07:53, Bruce Dawson wrote:
>
>> Bill McGonigle wrote:
>>> If it were someone editing a file, that would be a great solution.
>>> In this particular case I'm trying to catch an unlink - my hunch is
>>> lsof woudn't show anything.
>> How about monitoring the directory containing the file?
>> (/file/you/are/interested instead of /file/you/are/interested/in)
>
> I was being unclear - the issue I'm concerned with is that by time
> lsof fires, the rather atomic unlink operation is gone from the table
> of which resources are in use.  If only files had a FIN_WAIT. ;)
>

If it's a specific file you want to monitor, why not stash an
extra link to it somewhere? Then when the unlink happens, you
still have a way to reach the file. You can then unlink the
extra link when yo're done with it.


-- 
John Abreau / Executive Director, Boston Linux & Unix
IM: jabr at jabber.blu.org / abreauj at AIM / abreauj at Yahoo / zusa_it_mgr at Skype
Email jabr at blu.org / WWW http://www.abreau.net / PGP-Key-ID 0xD5C7B5D9
PGP-Key-Fingerprint 72 FB 39 4F 3C 3B D6 5B E0 C8 5A 6E F1 2C BE 99



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



More information about the gnhlug-discuss mailing list