FileT.loadContents

Loads the content of the file into memory. The data is always zero-terminated, but this is not included in the resultant length. The returned contents should be freed with glib.global.gfree when no longer needed.

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.types.IOErrorEnum.Cancelled will be returned.

template FileT()
override
bool
loadContents

Parameters

cancellable gio.cancellable.Cancellable

optional #GCancellable object, null to ignore

contents ubyte[]

a location to place the contents of the file

etagOut string

a location to place the current entity tag for the file, or null if the entity tag is not needed

Return Value

Type: bool

true if the file's contents were successfully loaded. false if there were errors.