MCPcopy Create free account
hub / github.com/HandBrake/HandBrake / dest_free_space

Function dest_free_space

gtk/src/queuehandler.c:1483–1509  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1481}
1482
1483static gint64 dest_free_space (GhbValue *settings)
1484{
1485 GFile *gfile;
1486 GFileInfo *info;
1487 guint64 size = -1;
1488 const gchar *dest = ghb_dict_get_string(settings, "destination");
1489 gchar *destdir = g_path_get_dirname(dest);
1490 gchar *resolved = ghb_resolve_symlink(destdir);
1491
1492 gfile = g_file_new_for_path(resolved);
1493 info = g_file_query_filesystem_info(gfile,
1494 G_FILE_ATTRIBUTE_FILESYSTEM_FREE, NULL, NULL);
1495 if (info != NULL)
1496 {
1497 if (g_file_info_has_attribute(info, G_FILE_ATTRIBUTE_FILESYSTEM_FREE))
1498 {
1499 size = g_file_info_get_attribute_uint64(info,
1500 G_FILE_ATTRIBUTE_FILESYSTEM_FREE);
1501 }
1502 g_object_unref(info);
1503 }
1504 g_object_unref(gfile);
1505 g_free(resolved);
1506 g_free(destdir);
1507
1508 return size;
1509}
1510
1511gint ghb_find_queue_job (GhbValue *queue, gint unique_id, GhbValue **job)
1512{

Callers 1

ghb_low_disk_checkFunction · 0.85

Calls 2

ghb_dict_get_stringFunction · 0.85
ghb_resolve_symlinkFunction · 0.85

Tested by

no test coverage detected