GNOME Bugzilla – Bug 720806
Implement query_info_on_{read,write} where possible
Last modified: 2018-09-21 17:37:34 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.
What's the main difference between the query_info and those methods excepting different api?
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.
Created attachment 274563 [details] [review] trash: Implement query_info_on_read() Implement query_info_on_read() by proxying to the underlying stream's implementation.
Created attachment 274564 [details] [review] recent: Implement query_info_on_read() Implement query_info_on_read() by proxying to the underlying stream's implementation.
Review of attachment 274563 [details] [review]: Looks good to me, thanks!
Review of attachment 274564 [details] [review]: Looks good to me, thanks!
Pushed to master as 41790cb90f2c4b0c647ea1df211387c9effa6133. Thanks for the reviews.
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.
-- 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.