Top |
gboolean | xfce_g_file_metadata_is_supported () |
gchar * | xfce_g_file_create_checksum () |
gboolean | xfce_g_file_set_trusted () |
gboolean | xfce_g_file_is_trusted () |
gboolean
xfce_g_file_metadata_is_supported (GFile *file
);
Checks if GVFS-metadata is available for
the file
provided.
Since: 4.17
gchar * xfce_g_file_create_checksum (GFile *file
,GCancellable *cancellable
,GError **error
);
Generates an SHA-256 hash of the file
.
file |
a GFile. |
|
cancellable |
optional GCancellable object, |
[nullable] |
error |
a GError. |
[nullable] |
Checksum of the file
.
If file read fails, returns NULL
. Free with g_free()
.
[transfer full][nullable]
Since: 4.17
gboolean xfce_g_file_set_trusted (GFile *file
,gboolean is_trusted
,GCancellable *cancellable
,GError **error
);
Sets the "safety flag" on if is_trusted
.
Safety flag is a new concept introduced in XFCE 4.17. It is basically an additional execution flag stored in GVFS-metadata. Unlike the execution flag (+x), it is safe to assume that this flag did not come from foreign location (for example, by downloading an tar archive) and is set by user.
The checksum of the file is stored, and would be considered "on" only if checksum matches with the file on execution.
file |
a GFile. |
|
is_trusted |
TRUE if trusted, FALSE if not |
|
cancellable |
optional GCancellable object, |
[nullable] |
error |
a GError. |
[nullable] |
Since: 4.17
gboolean xfce_g_file_is_trusted (GFile *file
,GCancellable *cancellable
,GError **error
);
Compares the checksum stored in safety flag with the actual file. If it matches, it is considered safe.
Read the documentation of
xfce_g_file_set_trusted()
for details.
file |
a GFile. |
|
cancellable |
optional GCancellable object, |
[nullable] |
error |
a GError. |
[nullable] |
Since: 4.17