Re: Updating date and time of folders ?


On Sat, 2006-12-16 at 00:55 +0100, Stephan Hegel wrote:
> I've thought that a folder or directory is just a kind of list (incl. some
> meta data) of all the item it contains. And when I move a file into this
> folder, this file must be added to this list/index somehow ?

This is the case for the on-disk file system, yes.  But when files are
moved to and from folders, that doesn't trigger a change in the Beagle
indexes.  The information you see for folders -- that is, the number of
items inside it and the last modified time -- is just pulled from the
file system when the tile is built.

An event from the daemon is what's typically needed to rebuild the tile.
Since the indexed representation of the folder doesn't change, that
event isn't sent.  Like I said, we could perhaps synthesize these
events, but I haven't looked enough into the problem to know at this
point how easy or hard that would be.

> I've noticed that just "touch"ing a file triggers an event in beagle,
> touching a directory does not. This isn't consistent.

This inconsistency is actually due to the way the touch program works,
and how Beagle interprets the subsequent inotify events.

Beagle doesn't listen for changes to "attributes": things like
ownership, mode, timestamps and extended attributes.  It listens for
"CloseWrite" events.  That is, when files that were opened for writing
(either write-only or read/write) are closed.

touch(1) opens files write-only, updates their timestamp using
utimes(3), and closes the file.  This causes Open, Attrib, and
CloseWrite inotify events to be fired off.  Again, of these three,
Beagle only listens for CloseWrite.

Directories, on the other hand, are attempted to be opened, but this
fails because it's a directory.  Its timestamp is updated in the same
way as a file.  This causes only an Attrib event.

So in this case, it's important to keep in mind that the mechanics of
touch are why a file is reindexed by Beagle, not a specific side effect.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]