read_fn


Description:

[ Deprecated ( since = "vala-0.16" , replacement = "read" ) ]
[ NoWrapper ]
public abstract weak FileInputStream read_fn (Cancellable? cancellable = null) throws Error

Warning: read_fn is deprecated. Use GLib.File.read.

Opens a file for reading.

The result is a 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 g_io_error_cancelled will be returned.

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

Parameters:

this

File to read

cancellable

a Cancellable

Returns:

FileInputStream or null on error. Free the returned object with unref.