1.37 <GFileOutputStream>

Class: <GFileOutputStream>

It derives from <GOutputStream>.

<GFileOutputStream> provides output streams that write their content to a file.

<GFileOutputStream> implements <GSeekable>, which allows the output 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 output stream, use seekable:tell. To find out if a file output stream supports seeking, use seekable:can-seek?.To position a file output stream, use seekable:seek?. To find out if a file output stream supports truncating, use seekable:can-truncate?. To truncate a file output stream, use seekable:truncate?.

Fields

parent-instance

Procedures

Method: file-output-stream:get-etag self ⇒ %return
Method: get-etag self ⇒ %return

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.

self

Passed: a <GFileOutputStream>.

a <GFileOutputStream>.

%return

Returned: a string, or #f.

the entity tag for the stream.

Method: file-output-stream:query-info self attributes [cancellable] ⇒ %return
Method: query-info self attributes [cancellable] ⇒ %return

Queries a file output stream for the given attributes. This function blocks while querying the stream. For the asynchronous version of this function, see file-output-stream:query-info-async. While the stream is blocked, the stream will set the pending flag internally, and any other operations on the stream will fail with pending.

Can fail if the stream was already closed (with error being set to closed), the stream has pending operations (with error being set to pending), or if querying info is not supported for the stream’s interface (with error being set to not-supported). In all cases of failure, #f will be returned.

If cancellable is not #f, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error cancelled will be set, and #f will be returned.

self

Passed: a <GFileOutputStream>.

a <GFileOutputStream>.

attributes

Passed: a string.

a file attribute query string.

cancellable

Passed, or left out: a <GCancellable>, or #f.

optional <GCancellable> object, #f to ignore.

%return

Returned: a <GFileInfo>.

a <GFileInfo> for the self, or #f on error.

Method: file-output-stream:query-info-async self attributes io-priority [cancellable] [callback]
Method: query-info-async self attributes io-priority [cancellable] [callback]

Asynchronously queries the self for a <GFileInfo>. When completed, callback will be called with a <GAsyncResult> which can be used to finish the operation with file-output-stream:query-info-finish.

For the synchronous version of this function, see file-output-stream:query-info.

self

Passed: a <GFileOutputStream>.

a <GFileOutputStream>.

attributes

Passed: a string.

a file attribute query string.

io-priority

Passed: a 32-bit integer.

the I/O priority of the request

cancellable

Passed, or left out: a <GCancellable>, or #f.

optional <GCancellable> object, #f to ignore.

callback

Passed, or left out: a procedure, or #f.

callback to call when the request is satisfied

See GAsyncReadyCallback for how it is called.

user-data

Not passed: guile-gi supplies it.

the data to pass to callback function

Method: file-output-stream:query-info-finish self result ⇒ %return
Method: query-info-finish self result ⇒ %return

Finalizes the asynchronous query started by file-output-stream:query-info-async.

self

Passed: a <GFileOutputStream>.

a <GFileOutputStream>.

result

Passed: a <GAsyncResult>.

a <GAsyncResult>.

%return

Returned: a <GFileInfo>.

A <GFileInfo> for the finished query.

Virtual methods

Virtual method: file-output-stream:do-can-seek implementor self ⇒ %return

To override it in a new class, give register-type #:vfuncs `((can-seek . ,procedure)). The procedure is called as (procedure self) ⇒ %return.

implementor

Passed: the class whose implementation to call: <GFileOutputStream>, or a class that derives from it, or its GType number.

self

Passed: a <GFileOutputStream>.

%return

Returned: a boolean.

Virtual method: file-output-stream:do-can-truncate implementor self ⇒ %return

To override it in a new class, give register-type #:vfuncs `((can-truncate . ,procedure)). The procedure is called as (procedure self) ⇒ %return.

implementor

Passed: the class whose implementation to call: <GFileOutputStream>, or a class that derives from it, or its GType number.

self

Passed: a <GFileOutputStream>.

%return

Returned: a boolean.

Virtual method: file-output-stream:do-get-etag implementor self ⇒ %return

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.

To override it in a new class, give register-type #:vfuncs `((get-etag . ,procedure)). The procedure is called as (procedure self) ⇒ %return.

implementor

Passed: the class whose implementation to call: <GFileOutputStream>, or a class that derives from it, or its GType number.

self

Passed: a <GFileOutputStream>.

a <GFileOutputStream>.

%return

Returned: a string, or #f.

the entity tag for the stream.

Virtual method: file-output-stream:do-query-info implementor self attributes [cancellable] ⇒ %return

Queries a file output stream for the given attributes. This function blocks while querying the stream. For the asynchronous version of this function, see file-output-stream:query-info-async. While the stream is blocked, the stream will set the pending flag internally, and any other operations on the stream will fail with pending.

Can fail if the stream was already closed (with error being set to closed), the stream has pending operations (with error being set to pending), or if querying info is not supported for the stream’s interface (with error being set to not-supported). In all cases of failure, #f will be returned.

If cancellable is not #f, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error cancelled will be set, and #f will be returned.

To override it in a new class, give register-type #:vfuncs `((query-info . ,procedure)). The procedure is called as (procedure self attributes cancellable) ⇒ %return.

implementor

Passed: the class whose implementation to call: <GFileOutputStream>, or a class that derives from it, or its GType number.

self

Passed: a <GFileOutputStream>.

a <GFileOutputStream>.

attributes

Passed: a string.

a file attribute query string.

cancellable

Passed, or left out: a <GCancellable>, or #f.

optional <GCancellable> object, #f to ignore.

%return

Returned: a <GFileInfo>.

a <GFileInfo> for the self, or #f on error.

Virtual method: file-output-stream:do-query-info-async implementor self attributes io-priority [cancellable] [callback]

Asynchronously queries the self for a <GFileInfo>. When completed, callback will be called with a <GAsyncResult> which can be used to finish the operation with file-output-stream:query-info-finish.

For the synchronous version of this function, see file-output-stream:query-info.

To override it in a new class, give register-type #:vfuncs `((query-info-async . ,procedure)). The procedure is called as (procedure self attributes io-priority cancellable callback user-data).

implementor

Passed: the class whose implementation to call: <GFileOutputStream>, or a class that derives from it, or its GType number.

self

Passed: a <GFileOutputStream>.

a <GFileOutputStream>.

attributes

Passed: a string.

a file attribute query string.

io-priority

Passed: a 32-bit integer.

the I/O priority of the request

cancellable

Passed, or left out: a <GCancellable>, or #f.

optional <GCancellable> object, #f to ignore.

callback

Passed, or left out: a procedure, or #f.

callback to call when the request is satisfied

See GAsyncReadyCallback for how it is called.

user-data

Not passed: guile-gi supplies it.

the data to pass to callback function

Virtual method: file-output-stream:do-query-info-finish implementor self result ⇒ %return

Finalizes the asynchronous query started by file-output-stream:query-info-async.

To override it in a new class, give register-type #:vfuncs `((query-info-finish . ,procedure)). The procedure is called as (procedure self result) ⇒ %return.

implementor

Passed: the class whose implementation to call: <GFileOutputStream>, or a class that derives from it, or its GType number.

self

Passed: a <GFileOutputStream>.

a <GFileOutputStream>.

result

Passed: a <GAsyncResult>.

a <GAsyncResult>.

%return

Returned: a <GFileInfo>.

A <GFileInfo> for the finished query.

Virtual method: file-output-stream:do-seek implementor self offset type [cancellable] ⇒ %return

To override it in a new class, give register-type #:vfuncs `((seek . ,procedure)). The procedure is called as (procedure self offset type cancellable) ⇒ %return.

implementor

Passed: the class whose implementation to call: <GFileOutputStream>, or a class that derives from it, or its GType number.

self

Passed: a <GFileOutputStream>.

offset

Passed: a 64-bit integer.

type

Passed: a <%GSeekType>, or one of its symbols.

cancellable

Passed, or left out: a <GCancellable>, or #f.

%return

Returned: a boolean.

Virtual method: file-output-stream:do-tell implementor self ⇒ %return

To override it in a new class, give register-type #:vfuncs `((tell . ,procedure)). The procedure is called as (procedure self) ⇒ %return.

implementor

Passed: the class whose implementation to call: <GFileOutputStream>, or a class that derives from it, or its GType number.

self

Passed: a <GFileOutputStream>.

%return

Returned: a 64-bit integer.

Virtual method: file-output-stream:do-truncate-fn implementor self size [cancellable] ⇒ %return

To override it in a new class, give register-type #:vfuncs `((truncate-fn . ,procedure)). The procedure is called as (procedure self size cancellable) ⇒ %return.

implementor

Passed: the class whose implementation to call: <GFileOutputStream>, or a class that derives from it, or its GType number.

self

Passed: a <GFileOutputStream>.

size

Passed: a 64-bit integer.

cancellable

Passed, or left out: a <GCancellable>, or #f.

%return

Returned: a boolean.