mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-11 23:16:14 +01:00
gio-tool: add a "default-modified-time" option
As with `default-permissions` option, this overrides the `perserve` option.
This commit is contained in:
parent
db01c11540
commit
c70b8a7500
@ -40,6 +40,7 @@ static gboolean preserve = FALSE;
|
||||
static gboolean backup = FALSE;
|
||||
static gboolean no_dereference = FALSE;
|
||||
static gboolean default_permissions = FALSE;
|
||||
static gboolean default_modified_time = FALSE;
|
||||
|
||||
static const GOptionEntry entries[] = {
|
||||
{ "no-target-directory", 'T', 0, G_OPTION_ARG_NONE, &no_target_directory, N_("No target directory"), NULL },
|
||||
@ -49,6 +50,7 @@ static const GOptionEntry entries[] = {
|
||||
{ "backup", 'b', 0, G_OPTION_ARG_NONE, &backup, N_("Backup existing destination files"), NULL },
|
||||
{ "no-dereference", 'P', 0, G_OPTION_ARG_NONE, &no_dereference, N_("Never follow symbolic links"), NULL },
|
||||
{ "default-permissions", 0, 0, G_OPTION_ARG_NONE, &default_permissions, N_("Use default permissions for the destination"), NULL },
|
||||
{ "default-modified-time", 0, 0, G_OPTION_ARG_NONE, &default_modified_time, N_("Use default file modification timestamps for the destination"), NULL },
|
||||
G_OPTION_ENTRY_NULL
|
||||
};
|
||||
|
||||
@ -181,6 +183,8 @@ handle_copy (int argc, char *argv[], gboolean do_help)
|
||||
flags |= G_FILE_COPY_ALL_METADATA;
|
||||
if (default_permissions)
|
||||
flags |= G_FILE_COPY_TARGET_DEFAULT_PERMS;
|
||||
if (default_modified_time)
|
||||
flags |= G_FILE_COPY_TARGET_DEFAULT_MODIFIED_TIME;
|
||||
|
||||
error = NULL;
|
||||
start_time = g_get_monotonic_time ();
|
||||
|
Loading…
Reference in New Issue
Block a user