GObject.Object
Gio.IOStream
Gio.FileIOStream
Import line: | Gio = imports.gi.Gio; |
GIR File: | Gio-2.0.gir |
C documentation: | GFileIOStream |
Class : | FileIOStream |
Implements: | Gio.Seekable |
Extends: | Gio.IOStream |
Properties | Defined By | |
---|---|---|
closed : gboolean
|
Gio.IOStream | |
input_stream : Gio.InputStream
read only
|
Gio.IOStream | |
output_stream : Gio.OutputStream
read only
|
Gio.IOStream | |
parent_instance : Gio.IOStream
read only
|
Gio.FileIOStream | |
priv : Gio.FileIOStreamPrivate
read only
|
Gio.FileIOStream |
Method / Constructor | Defined By | |
---|---|---|
new Gio.FileIOStream
(Object properties)
Create a new Gio.FileIOStream
Create a new Gio.FileIOStream
|
||
can_seek
()
:
gboolean
Tests if the stream supports the GSeekableIface.
Tests if the stream supports the GSeekableIface.
|
Gio.Seekable | |
can_truncate
()
:
gboolean
Tests if the stream can be truncated.
Tests if the stream can be truncated.
|
Gio.Seekable | |
clear_pending
()
:
none
Clears the pending flag on stream.
Clears the pending flag on stream.
|
Gio.IOStream | |
close
(Cancellable cancellable)
:
gboolean
Closes the stream, releasing resources related to it.
Closes the stream, releasing resources related to it. This will also
closes the individual input and output streams, if they are not already closed. Once the stream is closed, all other operations will return G_IO_ERROR_CLOSED. Closing a stream multiple times will not return an error. Closing a stream will automatically flush any outstanding buffers in the stream. Streams will be automatically closed when the last reference is dropped, but you might want to call this function to make sure resources are released as early as possible. Some streams might keep the backing store of the stream (e.g. a file descriptor) open after the stream is closed. See the documentation for the individual stream for details. On failure the first error that happened will be reported, but the close operation will finish as much as possible. A stream that failed to close will still return G_IO_ERROR_CLOSED for all operations. Still, it is important to check and report the error to the user, otherwise there might be a loss of data as all data might not be written. If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned. Cancelling a close will still leave the stream closed, but some streams can use a faster close that doesn't block to e.g. check errors. The default implementation of this method just calls close on the individual input/output streams.
|
Gio.IOStream | |
close_async
(gint32 io_priority, Cancellable cancellable, Function callback, void* user_data)
:
none
Requests an asynchronous close of the stream, releasing resources
related to it.
Requests an asynchronous close of the stream, releasing resources
related to it. When the operation is finished callback will be called. You can then call g_io_stream_close_finish() to get the result of the operation. For behaviour details see g_io_stream_close(). The asynchronous methods have a default fallback that uses threads to implement asynchronicity, so they are optional for inheriting classes. However, if you override one you must override all.
|
Gio.IOStream | |
close_finish
(AsyncResult result)
:
gboolean
Closes a stream.
Closes a stream.
|
Gio.IOStream | |
get_etag
()
:
String
Gets the entity tag for the file when it has been written.
Gets the entity tag for the file when it has been written.
This must be called after the stream has been written and closed, as the etag can change while writing.
|
Gio.FileIOStream | |
get_input_stream
()
:
Gio.InputStream
Gets the input stream for this object.
Gets the input stream for this object. This is used
for reading. Do not free.
|
Gio.IOStream | |
get_output_stream
()
:
Gio.OutputStream
Gets the output stream for this object.
Gets the output stream for this object. This is used for
writing. Do not free.
|
Gio.IOStream | |
has_pending
()
:
gboolean
Checks if a stream has pending actions.
Checks if a stream has pending actions.
|
Gio.IOStream | |
is_closed
()
:
gboolean
Checks if a stream is closed.
Checks if a stream is closed.
|
Gio.IOStream | |
Queries a file io stream for the given attributes.
Queries a file io stream for the given attributes.
This function blocks while querying the stream. For the asynchronous version of this function, see g_file_io_stream_query_info_async(). While the stream is blocked, the stream will set the pending flag internally, and any other operations on the stream will fail with G_IO_ERROR_PENDING. Can fail if the stream was already closed (with error being set to G_IO_ERROR_CLOSED), the stream has pending operations (with error being set to G_IO_ERROR_PENDING), or if querying info is not supported for the stream's interface (with error being set to G_IO_ERROR_NOT_SUPPORTED). I all cases of failure, NULL will be returned. If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be set, and NULL will be returned.
|
Gio.FileIOStream | |
query_info_async
(String attributes, gint32 io_priority, Cancellable cancellable, Function callback, void* user_data)
:
none
Asynchronously queries the stream for a GFileInfo.
Asynchronously queries the stream for a GFileInfo. When completed,
finish the operation with g_file_io_stream_query_info_finish(). For the synchronous version of this function, see g_file_io_stream_query_info().
|
Gio.FileIOStream | |
query_info_finish
(AsyncResult result)
:
Gio.FileInfo
Finalizes the asynchronous query started
by g_file_io_stream_query_info_async().
Finalizes the asynchronous query started
by g_file_io_stream_query_info_async().
|
Gio.FileIOStream | |
Seeks in the stream by the given offset, modified by type.
Seeks in the stream by the given offset, modified by type.
If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned. has occurred, this function will return FALSE and set error appropriately if present.
|
Gio.Seekable | |
set_pending
()
:
gboolean
Sets stream to have actions pending.
Sets stream to have actions pending. If the pending flag is
already set or stream is closed, it will return FALSE and set
|
Gio.IOStream | |
splice_async
(IOStream stream2, IOStreamSpliceFlags flags, gint32 io_priority, Cancellable cancellable, Function callback, void* user_data)
:
none
Asyncronously splice the output stream of stream1 to the input stream of
When the operation is finished callback will be called.
Asyncronously splice the output stream of stream1 to the input stream of
When the operation is finished callback will be called. You can then call g_io_stream_splice_finish() to get the result of the operation.
|
Gio.IOStream | |
tell
()
:
gint64
Tells the current position within the stream.
Tells the current position within the stream.
|
Gio.Seekable | |
Truncates a stream with a given offset.
Truncates a stream with a given offset.
If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned. If an operation was partially finished when the operation was cancelled the partial result will be returned, without an error. has occurred, this function will return FALSE and set error appropriately if present.
|
Gio.Seekable |
None |
Class / Namespace | Method / Signal / Properties |
---|---|
Gio.File
Method |
Creates a new file and returns a stream for reading and writing to it.
|
Gio.File
Method |
create_readwrite_finish
(AsyncResult res)
:
Gio.FileIOStream
Finishes an asynchronous file create operation started with
g_file_create_readwrite_async(). |
Gio.File
Method |
open_readwrite
(Cancellable cancellable)
:
Gio.FileIOStream
Opens an existing file for reading and writing.
|
Gio.File
Method |
open_readwrite_finish
(AsyncResult res)
:
Gio.FileIOStream
Finishes an asynchronous file read operation started with
g_file_open_readwrite_async(). |
Gio.File
Method |
replace_readwrite
(String etag, gboolean make_backup, FileCreateFlags flags, Cancellable cancellable)
:
Gio.FileIOStream
Returns an output stream for overwriting the file in readwrite mode,
possibly creating a backup copy of the file first. |
Gio.File
Method |
replace_readwrite_finish
(AsyncResult res)
:
Gio.FileIOStream
Finishes an asynchronous file replace operation started with
g_file_replace_readwrite_async(). |