Create  Edit  FrontPage  Index  Search  Changes  History  RSS  Login

GLib::FileOutputStream

class GLib::FileOutputStream

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

GLib::FileOutputStream 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

can_seek?
See GLib::Seekable#can_seek?.
can_truncate?
See GLib::Seekable#can_truncate?.
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.
  • 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
query_info_finish(result)

Finishes an asynchronous info query operation.

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

seek
See GLib::Seekable#seek.
tell
See GLib::Seekable#tell.
truncate
See GLib::Seekable#truncate.
Last modified:2010/12/27 21:59:23
Keyword(s):
References:[Ruby/GIO] [index-ruby-gio2] [GLib::FileOutputStream] [GLib::OutputStream] [GLib::File] [index-ruby-glib2] [GLib::FileInfo] [GLib::Seekable]