Index: gio/glocalfileoutputstream.c
===================================================================
--- gio/glocalfileoutputstream.c	(revision 6871)
+++ gio/glocalfileoutputstream.c	(working copy)
@@ -36,6 +36,7 @@
 #include "glibintl.h"
 #include "gioerror.h"
 #include "glocalfileoutputstream.h"
+#include "glocalfileinputstream.h"
 #include "glocalfileinfo.h"
 
 #ifdef G_OS_WIN32
@@ -505,7 +506,15 @@
   else
     mode = 0666;
 
-  fd = g_open (filename, O_CREAT | O_APPEND | O_WRONLY | O_BINARY, mode);
+
+  if (flags & G_FILE_CREATE_READWRITE)
+    {
+      fd = g_open (filename, O_CREAT | O_RDWR | O_BINARY, mode);
+    }
+  else
+    {
+      fd = g_open (filename, O_CREAT | O_APPEND | O_WRONLY | O_BINARY, mode);
+    }
   if (fd == -1)
     {
       int errsv = errno;
@@ -529,6 +538,14 @@
   
   stream = g_object_new (G_TYPE_LOCAL_FILE_OUTPUT_STREAM, NULL);
   stream->priv->fd = fd;
+
+  if (flags & G_FILE_CREATE_READWRITE)
+    {
+      GFileInputStream *istream;
+
+      istream = _g_local_file_input_stream_new (fd);
+      g_object_set_data (G_OBJECT (stream), "istream", istream);
+    }
   
   return G_FILE_OUTPUT_STREAM (stream);
 }
Index: gio/gfile.h
===================================================================
--- gio/gfile.h	(revision 6871)
+++ gio/gfile.h	(working copy)
@@ -59,12 +59,14 @@
  * @G_FILE_CREATE_NONE: No flags set.
  * @G_FILE_CREATE_PRIVATE: Create a file that can only be 
  *    accessed by the current user.
+ * @G_FILE_CREATE_READWRITE: Create a file that can only be 
  * 
  * Flags used when an operation may create a file.
  */
 typedef enum  {
   G_FILE_CREATE_NONE = 0,
-  G_FILE_CREATE_PRIVATE = (1<<0)
+  G_FILE_CREATE_PRIVATE = (1<<0),
+  G_FILE_CREATE_READWRITE = (1<<1)
 } GFileCreateFlags;
 
 
