Buscar

Este contenido no está disponible en el idioma seleccionado.

15.9. Using GVFS Metadata

download PDF
GVFS has its metadata storage implemented as a set of simple key/value pairs information bound to a particular file. Thus, there is a tool for a user or application to save small data designed for runtime information such as icon position, last-played location, position in a document, emblems, notes, and so on.
Whenever a file or directory is moved, metadata is moved accordingly so that it stays connected to the respective file. GVFS stores all metadata privately so it is available only on the machine. However, GVFS mounts and removable media are tracked as well.

Note

Removable media are now mounted in the /run/media/ instead of the /media directory.
To view and manipulate with metadata, you can use:
  • the gvfs-info command;
  • the gvfs-set-attribute command;
  • or any other native GIO way of working with attributes.
In the following example, a custom metadata attribute is set. Notice the differences between particular gvfs-info calls and data persistence after a move or rename (note the gvfs-info command output):

Example 15.5. Setting Custom Metadata Attribute

$ touch /tmp/myfile
$ gvfs-info -a 'metadata::*' /tmp/myfile
attributes:
$ gvfs-set-attribute -t string /tmp/myfile 'metadata::mynote' 'Please remember to delete this file!'
$ gvfs-info -a 'metadata::*' /tmp/myfile
attributes:
  metadata::mynote: Please remember to delete this file!
$ gvfs-move /tmp/myfile /tmp/newfile
$ gvfs-info -a 'metadata::*' /tmp/newfile
attributes:
  metadata::mynote: Please remember to delete this file!
Red Hat logoGithubRedditYoutubeTwitter

Aprender

Pruebe, compre y venda

Comunidades

Acerca de la documentación de Red Hat

Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar.

Hacer que el código abierto sea más inclusivo

Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.

Acerca de Red Hat

Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.

© 2024 Red Hat, Inc.