diff options
author | Thomas Hindoe Paaboel Andersen <phomes@gmail.com> | 2011-12-08 23:17:07 +0100 |
---|---|---|
committer | Dan Winship <danw@gnome.org> | 2011-12-09 08:58:05 -0500 |
commit | 721667399a2ebc198292ecb5bfedc8f296aef04d (patch) | |
tree | 8f3c52cb347131953f289b1a049f891eef0c52df /gio/glocalfileoutputstream.c | |
parent | e50d8a11b273498407cd360330533bda80e1f38d (diff) | |
download | glib-721667399a2ebc198292ecb5bfedc8f296aef04d.tar.gz |
GFile: add g_file_new_temp
A convenience function that creates a temporary file and returns
a GFile and GFileIOStream for it.
The file is created using g_file_open_tmp.
https://bugzilla.gnome.org/show_bug.cgi?id=657085
Diffstat (limited to 'gio/glocalfileoutputstream.c')
-rw-r--r-- | gio/glocalfileoutputstream.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gio/glocalfileoutputstream.c b/gio/glocalfileoutputstream.c index aff270c0c..a310fcd7d 100644 --- a/gio/glocalfileoutputstream.c +++ b/gio/glocalfileoutputstream.c @@ -541,6 +541,16 @@ g_local_file_output_stream_query_info (GFileOutputStream *stream, } GFileOutputStream * +_g_local_file_output_stream_new (int fd) +{ + GLocalFileOutputStream *stream; + + stream = g_object_new (G_TYPE_LOCAL_FILE_OUTPUT_STREAM, NULL); + stream->priv->fd = fd; + return G_FILE_OUTPUT_STREAM (stream); +} + +GFileOutputStream * _g_local_file_output_stream_open (const char *filename, gboolean readable, GCancellable *cancellable, |