aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-util.c
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@src.gnome.org>2006-05-25 14:04:48 +0800
committerSrinivasa Ragavan <sragavan@src.gnome.org>2006-05-25 14:04:48 +0800
commit24368cf92dd5eaae1b41b3f191a25e2cbc45e824 (patch)
treef250be111bc4afa6440414ada53ff051bb30ff0d /e-util/e-util.c
parent0fdf8a120ccb5638527293f6155d0e16af571732 (diff)
downloadgsoc2013-evolution-24368cf92dd5eaae1b41b3f191a25e2cbc45e824.tar.gz
gsoc2013-evolution-24368cf92dd5eaae1b41b3f191a25e2cbc45e824.tar.zst
gsoc2013-evolution-24368cf92dd5eaae1b41b3f191a25e2cbc45e824.zip
Added code to save/attach files/mails/events to/from remote shares
svn path=/trunk/; revision=32023
Diffstat (limited to 'e-util/e-util.c')
-rw-r--r--e-util/e-util.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/e-util/e-util.c b/e-util/e-util.c
index 73a1842919..bfafdc8771 100644
--- a/e-util/e-util.c
+++ b/e-util/e-util.c
@@ -39,6 +39,7 @@
#include <glib/gstdio.h>
#include <gtk/gtk.h>
#include <libgnome/gnome-util.h>
+#include <libgnomevfs/gnome-vfs.h>
#ifdef G_OS_WIN32
#include <windows.h>
@@ -239,6 +240,35 @@ e_write_file(const char *filename, const char *data, int flags)
}
gint
+e_write_file_uri (const char *filename, const char *data)
+{
+ guint64 length = strlen(data);
+ guint64 bytes;
+ GnomeVFSResult result;
+ GnomeVFSHandle *handle = NULL;
+
+ result = gnome_vfs_create (&handle, filename, GNOME_VFS_OPEN_WRITE, TRUE, 0755);
+ if (result != GNOME_VFS_OK) {
+ g_warning ("Couldn't save item");
+ return 1;
+ }
+
+ while (length > 0) {
+ gnome_vfs_write(handle, data, length, &bytes);
+ if (bytes > 0) {
+ length -= bytes;
+ data += bytes;
+ } else {
+ gnome_vfs_close(handle);
+ return 1;
+ }
+ }
+
+ gnome_vfs_close (handle);
+ return 0;
+}
+
+gint
e_write_file_mkstemp(char *filename, const char *data)
{
int fd;