diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2004-02-14 03:45:31 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2004-02-14 03:45:31 +0800 |
commit | fdacdc0bb9a57096680d44ff92aa24ff997bbff4 (patch) | |
tree | cc85ea0d2d800d3e660fb062570d0d9b79414564 /camel/providers/local/camel-mh-store.c | |
parent | bab092a05cc6b1c7d11954bfb65d2b0aa6d1ce6f (diff) | |
download | gsoc2013-evolution-fdacdc0bb9a57096680d44ff92aa24ff997bbff4.tar gsoc2013-evolution-fdacdc0bb9a57096680d44ff92aa24ff997bbff4.tar.gz gsoc2013-evolution-fdacdc0bb9a57096680d44ff92aa24ff997bbff4.tar.bz2 gsoc2013-evolution-fdacdc0bb9a57096680d44ff92aa24ff997bbff4.tar.lz gsoc2013-evolution-fdacdc0bb9a57096680d44ff92aa24ff997bbff4.tar.xz gsoc2013-evolution-fdacdc0bb9a57096680d44ff92aa24ff997bbff4.tar.zst gsoc2013-evolution-fdacdc0bb9a57096680d44ff92aa24ff997bbff4.zip |
Same.
2004-02-13 Jeffrey Stedfast <fejj@ximian.com>
* providers/imap/camel-imap-store.c (get_folder_online): Same.
* providers/local/camel-mh-store.c (get_folder): Same as maildir
changes.
* providers/local/camel-maildir-store.c (get_folder): Make
exceptions strings consistanmt with the mbox exception strings
(and vise versa). Also handle the CAMEL_STORE_FOLDER_EXCL flag.
* providers/local/camel-mbox-store.c (get_folder): Check
CAMEL_STORE_FOLDER_EXCL flag.
* providers/local/camel-local-store.c (get_folder): Simplified by
using camel_mkdir instead of doing it manually.
* camel-store.c (camel_store_get_folder): If the folder exists in
the cache and the O_EXCL flag was passed, return NULL and set an
exception.
* camel-store.h: Added a new CAMEL_STORE_FOLDER_EXCL flag for use
with get_folder().
svn path=/trunk/; revision=24738
Diffstat (limited to 'camel/providers/local/camel-mh-store.c')
-rw-r--r-- | camel/providers/local/camel-mh-store.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/camel/providers/local/camel-mh-store.c b/camel/providers/local/camel-mh-store.c index 73a3d2046f..b16c140a66 100644 --- a/camel/providers/local/camel-mh-store.c +++ b/camel/providers/local/camel-mh-store.c @@ -199,21 +199,22 @@ get_folder(CamelStore * store, const char *folder_name, guint32 flags, CamelExce if (stat(name, &st) == -1) { if (errno != ENOENT) { camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, - _("Could not open folder `%s':\n%s"), + _("Cannot get folder `%s': %s"), folder_name, g_strerror (errno)); g_free (name); return NULL; } if ((flags & CAMEL_STORE_FOLDER_CREATE) == 0) { camel_exception_setv(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER, - _("Folder `%s' does not exist."), folder_name); + _("Cannot get folder `%s': folder does not exist."), + folder_name); g_free (name); return NULL; } - if (mkdir(name, 0700) != 0) { + if (mkdir(name, 0777) != 0) { camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, - _("Could not create folder `%s':\n%s"), + _("Could not create folder `%s': %s"), folder_name, g_strerror (errno)); g_free (name); return NULL; @@ -223,13 +224,18 @@ get_folder(CamelStore * store, const char *folder_name, guint32 flags, CamelExce /* FIXME: throw exception on error */ if (((CamelMhStore *)store)->flags & CAMEL_MH_DOTFOLDERS) folders_update(((CamelLocalStore *)store)->toplevel_dir, folder_name, UPDATE_ADD); - } else if (!S_ISDIR(st.st_mode)) { camel_exception_setv(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER, - _("`%s' is not a directory."), name); + _("Cannot get folder `%s': not a directory."), folder_name); + g_free (name); + return NULL; + } else if (flags & CAMEL_STORE_FOLDER_EXCL) { + camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, + _("Cannot create folder `%s': folder exists."), folder_name); g_free (name); return NULL; } + g_free(name); return camel_mh_folder_new(store, folder_name, flags, ex); |