Gvfs metadata handling on removed / new files



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!


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