gio: Expose g_file_build_attribute_list_for_copy

Expose a function that prepares an attribute query string to be passed
to g_file_query_info() to get a list of attributes normally copied with
the file. This function is used by the implementation of
g_file_copy_attributes, and it's useful if one needs to split
g_file_copy_attributes into two stages, for example, when nautilus does
a recursive move of a directory. When files are moved from the source
directory, its modification time changes. To preserve the mtime on the
destination directory, it has to be queried before moving files and set
after doing it, hence these two stages.

Signed-off-by: Maxim Mikityanskiy <maxtram95@gmail.com>
This commit is contained in:
Maxim Mikityanskiy
2020-09-07 19:20:01 +03:00
committed by Philip Withnall
parent 5017de6567
commit 094eca7076
4 changed files with 149 additions and 45 deletions

View File

@@ -1094,6 +1094,12 @@ gboolean g_file_eject_mountable_with_operation_finish (GFile
GAsyncResult *result,
GError **error);
GLIB_AVAILABLE_IN_2_68
char * g_file_build_attribute_list_for_copy (GFile *file,
GFileCopyFlags flags,
GCancellable *cancellable,
GError **error);
GLIB_AVAILABLE_IN_ALL
gboolean g_file_copy_attributes (GFile *source,
GFile *destination,