lkml.org 
[lkml]   [2012]   [Jun]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectinotify: notify IN_DELETE_SELF when file is deleted or inode deleted ?
Hi,

By playing with inotify (on user side) to know whether the file I'm
using is deleted by someone else, I have noted that I do not receive
the IN_DELETE_SELF event, exactly because I'm using it. By checking into
kernel area, I see that at unlink(), an IN_ATTRIB event is sent, but
IN_DELETE_SELF is, indeed, sent only when the inode is deleted.

But such IN_ATTRIB event doesn't tell to the user what has changed among
permissions, timestamps, link count, etc...
So it doesn't much help. Of course, I have noted that I can monitor the
parent directory for IN_DELETE and then check which file has been
deleted; few more stuff to do but it works, no pb.

But I'm still wondering after reading in the man.:
IN_DELETE_SELF Watched file/directory was itself deleted.
Is this really the expected behavior ? Shouldn't the kernel trig such
event at unlink() ? Or is inotify clearly inode oriented ?

Thanks,

Pierre

PS: keep me in cc, I'm not subscribed to the list.


\
 
 \ /
  Last update: 2012-06-29 16:42    [W:0.025 / U:0.640 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site