Re: Gvfs metadata handling on removed / new files



Hi Nelson,

interesting issue, indeed. I'd say not using GIO file operations will
always get you out of sync. Same situation when you move
files/directories manually, gvfs metadata won't be updated.

AFAIK gvfs metadata system was designed for non-critical data storage
such as emblems, icon positions, custom notes etc and such non-standard
situation is probably an acceptable drawback. Alex would know more
though.

Thinking about it, there's a possibility to use xattrs and link back to
gvfs-metadata database with an unique ID. Xattrs are usually part of an
inode and are removed together with a file (unless it's hardlinked). The
downface is that xattrs are still not common these days, not all widely
used filesystems support them by default or are intentionally turned off
by default.

Monitoring is not easily possible since number of inotify slots is
limited and you can't really watch everything. I'd be interested how
tracker (or even zeitgeist?) do monitor changes on those big number of
folders.

-- 
Tomas Bzatek <tbzatek redhat com>

On Fri, 2011-12-09 at 11:01 +0100, Nelson Benítez León wrote:
> Hi,
> while resolving nautilus regression http://bugs.gnome.org/45953 I've
> come across an gvfs behaviour that I would like to ask you if it's a
> correct or not.. the thing is:
> 
>  file ~/Desktop/foo has some metadata (eg. stored by nautilus)
> rm ~/Desktop/foo
> now you create a new file on ~/Desktop/ with same name, a new ~/Desktop/foo
> this new ~/Desktop/foo carries the same metadata values as the old one.
> 
> that is.. because the file wasn't deleted with g_file_delete() but
> with rm then the metadata wasnt removed from internal gvfs, so when a
> new file is created in the same path and name, that file automatically
> has the same metadata values of the old removed file.
> 
> Is this a gvfs bug on handling removed/new files? if true, could it be fixed by:
> - gvfs monitoring external removes and delete metadata accordingly?
> - or better yet,  by discarding existent metadata when adding a new
> file that comes from external remove/add ?
> 
> 
> To reproduce it:
> 
> [inf@fedora16 ~]$ touch foo
> [inf@fedora16 ~]$ gvfs-set-attribute -t string foo metadata::myprop yeah
> [inf@fedora16 ~]$ gvfs-info foo | grep metadata
>   metadata::myprop: yeah
> [inf@fedora16 ~]$ rm foo
> [inf@fedora16 ~]$ gvfs-info foo | grep metadata
> Error getting info: Error stating file '/home/inf/foo': No such file
> or directory
> [inf@fedora16 ~]$ touch foo
> [inf@fedora16 ~]$ gvfs-info foo | grep metadata
>   metadata::myprop: yeah
> [inf@fedora16 ~]$ gvfs-info foo | grep metadata
> 
> 
> Thanks!
> _______________________________________________
> gvfs-list mailing list
> gvfs-list gnome org
> http://mail.gnome.org/mailman/listinfo/gvfs-list



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