| 1030 | } |
| 1031 | |
| 1032 | static void |
| 1033 | del_tree(const gchar *name, gboolean del_top) |
| 1034 | { |
| 1035 | const gchar *file; |
| 1036 | |
| 1037 | if (g_file_test(name, G_FILE_TEST_IS_DIR)) |
| 1038 | { |
| 1039 | GDir *gdir = g_dir_open(name, 0, NULL); |
| 1040 | file = g_dir_read_name(gdir); |
| 1041 | while (file) |
| 1042 | { |
| 1043 | gchar *path; |
| 1044 | path = g_strdup_printf("%s/%s", name, file); |
| 1045 | del_tree(path, TRUE); |
| 1046 | g_free(path); |
| 1047 | file = g_dir_read_name(gdir); |
| 1048 | } |
| 1049 | if (del_top) |
| 1050 | g_rmdir(name); |
| 1051 | g_dir_close(gdir); |
| 1052 | } |
| 1053 | else |
| 1054 | { |
| 1055 | g_unlink(name); |
| 1056 | } |
| 1057 | } |
| 1058 | |
| 1059 | const gchar* |
| 1060 | ghb_version (void) |