aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2003-09-24 05:03:19 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2003-09-24 05:03:19 +0800
commit020a8e0361c3641322a62b03912d8e29a06791ba (patch)
tree8fa46d424ba08e59878efaf5399f4689fc107906
parentc948d14546844ac68e4bb3b705cb7a227dd56684 (diff)
downloadgsoc2013-evolution-020a8e0361c3641322a62b03912d8e29a06791ba.tar.gz
gsoc2013-evolution-020a8e0361c3641322a62b03912d8e29a06791ba.tar.zst
gsoc2013-evolution-020a8e0361c3641322a62b03912d8e29a06791ba.zip
If the CREATE flag is set and the parent .sbd directory does not exist,
2003-09-23 Jeffrey Stedfast <fejj@ximian.com> * providers/local/camel-mbox-store.c (get_folder): If the CREATE flag is set and the parent .sbd directory does not exist, create it. svn path=/trunk/; revision=22677
-rw-r--r--camel/ChangeLog4
-rw-r--r--camel/camel-folder.c4
-rw-r--r--camel/providers/local/camel-mbox-store.c13
3 files changed, 19 insertions, 2 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 064105872f..cfe36ef306 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,5 +1,9 @@
2003-09-23 Jeffrey Stedfast <fejj@ximian.com>
+ * providers/local/camel-mbox-store.c (get_folder): If the CREATE
+ flag is set and the parent .sbd directory does not exist, create
+ it.
+
* camel-mime-utils.c (append_8bit): Don't forget to flush the
iconv conversion.
diff --git a/camel/camel-folder.c b/camel/camel-folder.c
index 79b7ecaf62..034905ed2b 100644
--- a/camel/camel-folder.c
+++ b/camel/camel-folder.c
@@ -193,10 +193,10 @@ camel_folder_finalize (CamelObject *object)
g_free(camel_folder->description);
if (camel_folder->parent_store)
- camel_object_unref (CAMEL_OBJECT (camel_folder->parent_store));
+ camel_object_unref (camel_folder->parent_store);
if (camel_folder->summary)
- camel_object_unref((CamelObject *)camel_folder->summary);
+ camel_object_unref (camel_folder->summary);
camel_folder_change_info_free(p->changed_frozen);
diff --git a/camel/providers/local/camel-mbox-store.c b/camel/providers/local/camel-mbox-store.c
index 0363047c6f..b0de165656 100644
--- a/camel/providers/local/camel-mbox-store.c
+++ b/camel/providers/local/camel-mbox-store.c
@@ -141,6 +141,7 @@ get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelExce
name = mbox_folder_name_to_path (store, folder_name);
if (stat (name, &st) == -1) {
+ char *dirname;
int fd;
if (errno != ENOENT) {
@@ -159,6 +160,18 @@ get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelExce
return NULL;
}
+ dirname = g_path_get_dirname (name);
+ if (camel_mkdir (dirname, 0777) == -1 && errno != EEXIST) {
+ camel_exception_setv (ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
+ _("Could not create directory `%s':\n%s"),
+ dirname, g_strerror (errno));
+ g_free (dirname);
+ g_free (name);
+ return NULL;
+ }
+
+ g_free (dirname);
+
fd = open (name, O_WRONLY | O_CREAT | O_APPEND, 0666);
if (fd == -1) {
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,