summaryrefslogtreecommitdiff
path: root/src/file-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/file-utils.c')
-rw-r--r--src/file-utils.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/file-utils.c b/src/file-utils.c
index 3b33480..7e1f170 100644
--- a/src/file-utils.c
+++ b/src/file-utils.c
@@ -1232,6 +1232,29 @@ get_home_relative_file (const char *partial_uri)
}
+GFile *
+get_user_config_subdirectory (const char *child_name,
+ gboolean create_child)
+{
+ char *full_path;
+ GFile *file;
+ GError *error = NULL;
+
+ full_path = g_strconcat (g_get_user_config_dir (), "/", child_name, NULL);
+ file = g_file_new_for_path (full_path);
+ g_free (full_path);
+
+ if (create_child && ! make_directory_tree (file, 0700, &error)) {
+ g_warning ("%s", error->message);
+ g_error_free (error);
+ g_object_unref (file);
+ file = NULL;
+ }
+
+ return file;
+}
+
+
const char *
remove_host_from_uri (const char *uri)
{