aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers
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 /camel/providers
parentc948d14546844ac68e4bb3b705cb7a227dd56684 (diff)
downloadgsoc2013-evolution-020a8e0361c3641322a62b03912d8e29a06791ba.tar
gsoc2013-evolution-020a8e0361c3641322a62b03912d8e29a06791ba.tar.gz
gsoc2013-evolution-020a8e0361c3641322a62b03912d8e29a06791ba.tar.bz2
gsoc2013-evolution-020a8e0361c3641322a62b03912d8e29a06791ba.tar.lz
gsoc2013-evolution-020a8e0361c3641322a62b03912d8e29a06791ba.tar.xz
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
Diffstat (limited to 'camel/providers')
-rw-r--r--camel/providers/local/camel-mbox-store.c13
1 files changed, 13 insertions, 0 deletions
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,