Skip to content

gfile: Fix file size detection when copying on btrfs

Ondrej Holy requested to merge wip/oholy/btrfs-copy-fix into main

When the g_file_copy function is used with files on BTRFS, the GLib-GIO-FATAL-CRITICAL: GFileInfo created without standard::size error is printed. This is because the g_file_get_size function is used to obtain the file size for the progress callback, but it uses the wrong GFileInfo object that is meant for attributes to be copied with the file. The file size attribute is missing there obviously. Let's obtain the file size over the fstat call the same way as it is done in the splice_stream_with_progress function to get rid of those errors and to fix the progress reporting.

Merge request reports