2

The gio shell command replaces the gvfs- suite for working with local and remote files on Gnome systems, using Gio over the Gvfs backend. For the most part it's quite effective, but I'm having a lot of difficulty understanding its tools for examining the boolean attributes in the thumbnail namespace.

gio info $URI will display all of the attributes for a supported file URI or local file path. gio info -a $selection $URI allows attribute namespaces or individual attributes to be queried. Mostly that works fine:

% gio info -a access test.png
uri: file:///var/tmp/test.png
attributes:
  access::can-read: TRUE
  access::can-write: TRUE
  access::can-execute: FALSE
  access::can-delete: TRUE
  access::can-trash: FALSE
  access::can-rename: TRUE

% gio info -a thumbnail test.png
uri: file:///var/tmp/test.png
attributes:
  thumbnail::path: /home/ferd/.cache/thumbnails/large/0953b0d1f71f9066deee9ac3fb72243b.png
  thumbnail::is-valid: TRUE

But if I try to query individual attributes, things get wonky once I'm in the thumbnail space:

% gio info -a access::can-read test.png
uri: file:///var/tmp/test.png
attributes:
  access::can-read: TRUE

% gio info -a thumbnail::path test.png
uri: file:///var/tmp/test.png
attributes:
  thumbnail::path: /home/ferd/.cache/thumbnails/large/0953b0d1f71f9066deee9ac3fb72243b.png

% gio info -a thumbnail::is-valid test.png
uri: file:///var/tmp/test.png
attributes:

% gio info -a thumbnail::failed test.png
uri: file:///var/tmp/test.png
attributes:

What's going on here? Why can't I query attributes like thumbnail::is-valid or thumbnail::failed individually? No matter what I do, gio info always produces no attribute output, whether the value is TRUE, FALSE, or if the attribute is absent entirely, which makes it awfully hard to determine which of those it is.

(Obviously I could query -a thumbnail and parse the output, this question is more about the confusing behavior of gio than about how to extract the values in question.)

I'm on a Fedora 26 machine, currently, with Gnome 3.24.3 and /usr/bin/gio from glib2-2.52.3-2.fc26.x86_64. The filesystem is ext4, and behavior is exactly the same for files in /home/ferd/Pictures as in these /var/tmp/ examples.

Update

At Sebastian's suggestion, filed as gnome bug #791325.

1 Answer 1

4

This is not really an issue with the gio command, but rather how this attribute is generated. The code where the attribute is generated is found in glib/gio/glocalfileinfo.c. This line is responsible for behavior you are seeing. It causes the is-valid attribute to only be generated if the query includes the path as well. I don't know if this is done intentionally, because the validity of the thumbnail is connected to its path or if this is just bug. You can file a bug report and bring this to the attention of the developers.

1
  • That is truly fascinating, and truly weird. You're quite correct: I can query the thumbnail:: booleans using gio info as long as I also query the thumbnail::path — even if it's not present! gio info -a thumbnail::path,thumbnail::failed $file for a file with a failed thumbnail will output the thumbnail::failed: TRUE result, whereas querying it without the path will not. ...That seems way too wonky to be working as intended, I'm definitely going to file a bug. Thanks.
    – FeRD
    Commented Dec 6, 2017 at 10:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .