Create  Edit  FrontPage  Index  Search  Changes  History  RSS  Login


class GLib::FileIOStream

GLib::FileIOStream provides input streams that take their content from a file.

GLib::FileIOStream implements GLib::Seekable, which allows the input stream to jump to arbitrary positions in the file, provided the filesystem of the file allows it. To find the position of a file input stream, use GLib::Seekable#tell. To find out if a file input stream supports seeking, use GLib::Seekable#can_seek?. To position a file input stream, use GLib::Seekable#seek.

Instance Methods

See GLib::Seekable#can_seek?.
See GLib::Seekable#can_truncate?.
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.
  • Returns: The entity tag for the stream
query_info(attributes, cancellable = nil)
Queries a file input stream for the given attributes. This function blocks while querying the stream. For the asynchronous (non-blocking) version of this function, see GLib::FileInputStream#query_info_async. While the stream is blocked, the stream will set the pending flag internally, and any other operations on the stream will raise GLib::IO::PendingError.
query_info_async(attributes, io_priority = GLib::PRIORITY_DEFAULT, cancellable = nil){ |result| }

Queries the stream information asynchronously. When the operation is finished, a GLib::AsyncResult is yielded. You can then call GLib::FileInputStream#query_info_finish to get the result of the operation.

For the synchronous version of this function, see GLib::FileInputStream#query_info.

If cancellable is not nil, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, GLib::IO::CancelledError will be raised.

  • attributes: A file attribute query String
  • io_priority: The I/O priority of the request
  • cancellable: Optional GLib::Cancellable object, nil to ignore
  • result: A GLib::AsyncResult
  • Returns: self

Finishes an asynchronous info query operation.

A GLib::IO::Error is raised if the GLib::FileInfo couldn’t be retrieved.

See GLib::Seekable#seek.
See GLib::Seekable#tell.
See GLib::Seekable#truncate.
Last modified:2010/12/27 21:59:23
References:[Ruby/GIO] [index-ruby-gio2] [GLib::Seekable] [GLib::FileIOStream] [GLib::File] [index-ruby-glib2] [GLib::IOStream]