Gio.FileIOStream

const Gio = imports.gi.Gio;

let fileIOStream = new Gio.FileIOStream();
  

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

GFileIOStream implements Gio.Seekable, 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 Gio.Seekable.prototype.tell.

To find out if a file io stream supports seeking, use Gio.Seekable.prototype.can_seek. To position a file io stream, use Gio.Seekable.prototype.seek. To find out if a file io stream supports truncating, use Gio.Seekable.prototype.can_truncate. To truncate a file io stream, use Gio.Seekable.prototype.truncate.

The default implementation of all the Gio.FileIOStream operations and the implementation of Gio.Seekable just call into the same operations on the output stream.

Hierarchy

  • GObject.Object
    • Gio.IOStream
      • Gio.FileIOStream