Gio.File::read_fn

function vfunc_read_fn(cancellable: Gio.Cancellable): Gio.FileInputStream {
}
  

Opens a file for reading. The result is a Gio.FileInputStream that can be used to read the contents of the file.

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 Gio.IOErrorEnum.cancelled will be returned.

If the file does not exist, the Gio.IOErrorEnum.not_found error will be returned. If the file is a directory, the Gio.IOErrorEnum.is_directory error will be returned. Other errors are possible too, and depend on what kind of filesystem the file is on.

cancellable

a Gio.Cancellable

Returns

Gio.FileInputStream or null on error. Free the returned object with GObject.Object.prototype.unref.