Add functionality to preserve nanosecond timestamps

file copy doesn't preserve nanosecond timestamps

Closes #369
This commit is contained in:
nitinosiris
2021-07-02 18:40:44 +05:30
committed by Philip Withnall
parent 7ad6b05458
commit b33ef610de
9 changed files with 252 additions and 25 deletions

View File

@@ -2998,6 +2998,20 @@ test_build_attribute_list_for_copy (void)
g_assert_null (g_strstr_len (attrs_with_commas, -1, "," G_FILE_ATTRIBUTE_TIME_ACCESS ","));
g_assert_null (g_strstr_len (attrs_with_commas, -1, "," G_FILE_ATTRIBUTE_TIME_ACCESS_USEC ","));
}
#endif
#ifdef HAVE_UTIMENSAT
g_assert_nonnull (g_strstr_len (attrs_with_commas, -1, "," G_FILE_ATTRIBUTE_TIME_MODIFIED ","));
g_assert_nonnull (g_strstr_len (attrs_with_commas, -1, "," G_FILE_ATTRIBUTE_TIME_MODIFIED_NSEC ","));
if (flags & G_FILE_COPY_ALL_METADATA)
{
g_assert_nonnull (g_strstr_len (attrs_with_commas, -1, "," G_FILE_ATTRIBUTE_TIME_ACCESS ","));
g_assert_nonnull (g_strstr_len (attrs_with_commas, -1, "," G_FILE_ATTRIBUTE_TIME_ACCESS_NSEC ","));
}
else
{
g_assert_null (g_strstr_len (attrs_with_commas, -1, "," G_FILE_ATTRIBUTE_TIME_ACCESS ","));
g_assert_null (g_strstr_len (attrs_with_commas, -1, "," G_FILE_ATTRIBUTE_TIME_ACCESS_NSEC ","));
}
#endif
g_free (attrs_with_commas);
}