Class

GioFileIOStream

Description [src]

class Gio.FileIOStream : Gio.IOStream {
  parent_instance: GIOStream
}

GFileIOStream provides io streams that both read and write to the same file handle.

GFileIOStream implements GSeekable, which allows the io stream to jump to arbitrary positions in the file and to truncate the file, provided the filesystem of the file supports these operations.

To find the position of a file io stream, use g_seekable_tell().

To find out if a file io stream supports seeking, use g_seekable_can_seek(). To position a file io stream, use g_seekable_seek(). To find out if a file io stream supports truncating, use g_seekable_can_truncate(). To truncate a file io stream, use g_seekable_truncate().

The default implementation of all the GFileIOStream operations and the implementation of GSeekable just call into the same operations on the output stream.

Available since:2.22

Hierarchy

hierarchy this GFileIOStream implements_0 GSeekable this--implements_0 ancestor_0 GIOStream ancestor_0--this ancestor_1 GObject ancestor_1--ancestor_0

Ancestors

Implements

Instance methods

g_file_io_stream_get_etag

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.

Available since: 2.22

g_file_io_stream_query_info

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.

Available since: 2.22

g_file_io_stream_query_info_async

Asynchronously queries the stream for a GFileInfo. When completed, callback will be called with a GAsyncResult which can be used to finish the operation with g_file_io_stream_query_info_finish().

Available since: 2.22

g_file_io_stream_query_info_finish

Finalizes the asynchronous query started by g_file_io_stream_query_info_async().

Available since: 2.22

Methods inherited from GIOStream (10)
g_io_stream_clear_pending

Clears the pending flag on stream.

Available since: 2.22

g_io_stream_close

Closes the stream, releasing resources related to it. This will also close the individual input and output streams, if they are not already closed.

Available since: 2.22

g_io_stream_close_async

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.

Available since: 2.22

g_io_stream_close_finish

Closes a stream.

Available since: 2.22

g_io_stream_get_input_stream

Gets the input stream for this object. This is used for reading.

Available since: 2.22

g_io_stream_get_output_stream

Gets the output stream for this object. This is used for writing.

Available since: 2.22

g_io_stream_has_pending

Checks if a stream has pending actions.

Available since: 2.22

g_io_stream_is_closed

Checks if a stream is closed.

Available since: 2.22

g_io_stream_set_pending

Sets stream to have actions pending. If the pending flag is already set or stream is closed, it will return FALSE and set error.

Available since: 2.22

g_io_stream_splice_async

Asynchronously splice the output stream of stream1 to the input stream of stream2, and splice the output stream of stream2 to the input stream of stream1.

Available since: 2.28

Methods inherited from GObject (43)
Methods inherited from GSeekable (5)
g_seekable_can_seek

Tests if the stream supports the GSeekableIface.

g_seekable_can_truncate

Tests if the length of the stream can be adjusted with g_seekable_truncate().

g_seekable_seek

Seeks in the stream by the given offset, modified by type.

g_seekable_tell

Tells the current position within the stream.

g_seekable_truncate

Sets the length of the stream to offset. If the stream was previously larger than offset, the extra data is discarded. If the stream was previously shorter than offset, it is extended with NUL (‘\0’) bytes.

Properties

Properties inherited from GIOStream (3)
Gio.IOStream:closed
No description available.
Gio.IOStream:input-stream
No description available.
Gio.IOStream:output-stream
No description available.

Signals

Signals inherited from GObject (1)

Class structure

struct GioFileIOStreamClass {
  GIOStreamClass parent_class;
  goffset (* tell) (
    GFileIOStream* stream
  );
  gboolean (* can_seek) (
    GFileIOStream* stream
  );
  gboolean (* seek) (
    GFileIOStream* stream,
    goffset offset,
    GSeekType type,
    GCancellable* cancellable,
    GError** error
  );
  gboolean (* can_truncate) (
    GFileIOStream* stream
  );
  gboolean (* truncate_fn) (
    GFileIOStream* stream,
    goffset size,
    GCancellable* cancellable,
    GError** error
  );
  GFileInfo* (* query_info) (
    GFileIOStream* stream,
    const char* attributes,
    GCancellable* cancellable,
    GError** error
  );
  void (* query_info_async) (
    GFileIOStream* stream,
    const char* attributes,
    int io_priority,
    GCancellable* cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data
  );
  GFileInfo* (* query_info_finish) (
    GFileIOStream* stream,
    GAsyncResult* result,
    GError** error
  );
  char* (* get_etag) (
    GFileIOStream* stream
  );
  void (* _g_reserved1) (
void
  );
  void (* _g_reserved2) (
void
  );
  void (* _g_reserved3) (
void
  );
  void (* _g_reserved4) (
void
  );
  void (* _g_reserved5) (
void
  );
  
}
Class members
parent_class
GIOStreamClass
  No description available.
tell
goffset (* tell) (
    GFileIOStream* stream
  )
  No description available.
can_seek
gboolean (* can_seek) (
    GFileIOStream* stream
  )
  No description available.
seek
gboolean (* seek) (
    GFileIOStream* stream,
    goffset offset,
    GSeekType type,
    GCancellable* cancellable,
    GError** error
  )
  No description available.
can_truncate
gboolean (* can_truncate) (
    GFileIOStream* stream
  )
  No description available.
truncate_fn
gboolean (* truncate_fn) (
    GFileIOStream* stream,
    goffset size,
    GCancellable* cancellable,
    GError** error
  )
  No description available.
query_info
GFileInfo* (* query_info) (
    GFileIOStream* stream,
    const char* attributes,
    GCancellable* cancellable,
    GError** error
  )
  No description available.
query_info_async
void (* query_info_async) (
    GFileIOStream* stream,
    const char* attributes,
    int io_priority,
    GCancellable* cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data
  )
  No description available.
query_info_finish
GFileInfo* (* query_info_finish) (
    GFileIOStream* stream,
    GAsyncResult* result,
    GError** error
  )
  No description available.
get_etag
char* (* get_etag) (
    GFileIOStream* stream
  )
  No description available.
_g_reserved1
void (* _g_reserved1) (
void
  )
  No description available.
_g_reserved2
void (* _g_reserved2) (
void
  )
  No description available.
_g_reserved3
void (* _g_reserved3) (
void
  )
  No description available.
_g_reserved4
void (* _g_reserved4) (
void
  )
  No description available.
_g_reserved5
void (* _g_reserved5) (
void
  )
  No description available.

Virtual methods

Gio.FileIOStreamClass.can_seek
No description available.
Gio.FileIOStreamClass.can_truncate
No description available.
Gio.FileIOStreamClass.get_etag

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.

Available since: 2.22

Gio.FileIOStreamClass.query_info

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.

Available since: 2.22

Gio.FileIOStreamClass.query_info_async

Asynchronously queries the stream for a GFileInfo. When completed, callback will be called with a GAsyncResult which can be used to finish the operation with g_file_io_stream_query_info_finish().

Available since: 2.22

Gio.FileIOStreamClass.query_info_finish

Finalizes the asynchronous query started by g_file_io_stream_query_info_async().

Available since: 2.22

Gio.FileIOStreamClass.seek
No description available.
Gio.FileIOStreamClass.tell
No description available.
Gio.FileIOStreamClass.truncate_fn
No description available.