After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 720806 - Implement query_info_on_{read,write} where possible
Implement query_info_on_{read,write} where possible
Status: RESOLVED OBSOLETE
Product: gvfs
Classification: Core
Component: general
git master
Other Linux
: Normal enhancement
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2013-12-20 05:45 UTC by Ross Lagerwall
Modified: 2018-09-21 17:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
trash: Implement query_info_on_read() (2.44 KB, patch)
2014-04-17 06:29 UTC, Ross Lagerwall
committed Details | Review
recent: Implement query_info_on_read() (2.49 KB, patch)
2014-04-17 06:29 UTC, Ross Lagerwall
committed Details | Review
afp: Implement query_info_on_{read,write}() (11.96 KB, patch)
2014-07-13 10:24 UTC, Ross Lagerwall
none Details | Review

Description Ross Lagerwall 2013-12-20 05:45:12 UTC
As per bug 706254 comment 11, backends should implement query_info_on_read() (and _write) where possible.

This can at least be done in afp, recent and trash.
Comment 1 Ondrej Holy 2014-01-09 18:23:18 UTC
What's the main difference between the query_info and those methods excepting different api?
Comment 2 Ross Lagerwall 2014-01-10 05:25:03 UTC
Well, it's like the difference between stat() and fstat().
One takes a path and gives info, the other takes a stream and gives info.

For why this is useful, consider querying a file and then opening it. This is racy, and it is possible that the file was replaced between these calls which means you get the wrong information about the file that you just opened. It is much better if you open the file and then query the info on that stream.

Given this, it wouldn't make sense to implement query_info_on_read for certain backends, like ftp where there is no way, given a stream to find info about it. However, this is definitely possible for backends like recent and trash.
Comment 3 Ross Lagerwall 2014-04-17 06:29:30 UTC
Created attachment 274563 [details] [review]
trash: Implement query_info_on_read()

Implement query_info_on_read() by proxying to the underlying stream's
implementation.
Comment 4 Ross Lagerwall 2014-04-17 06:29:44 UTC
Created attachment 274564 [details] [review]
recent: Implement query_info_on_read()

Implement query_info_on_read() by proxying to the underlying stream's
implementation.
Comment 5 Ondrej Holy 2014-04-24 12:39:02 UTC
Review of attachment 274563 [details] [review]:

Looks good to me, thanks!
Comment 6 Ondrej Holy 2014-04-24 12:39:21 UTC
Review of attachment 274564 [details] [review]:

Looks good to me, thanks!
Comment 7 Ross Lagerwall 2014-04-30 07:30:48 UTC
Pushed to master as 41790cb90f2c4b0c647ea1df211387c9effa6133. Thanks for the reviews.
Comment 8 Ross Lagerwall 2014-07-13 10:24:21 UTC
Created attachment 280576 [details] [review]
afp: Implement query_info_on_{read,write}()

Implement query_info_on_read and query_info_on_write.  Share common code
with query_info in query_info_fill_info.
Comment 9 GNOME Infrastructure Team 2018-09-21 17:37:34 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gvfs/issues/219.