6.17 GFileMeasureProgressCallback

Callback: GFileMeasureProgressCallback

A procedure given for it is called as (procedure reporting current-size num-dirs num-files). If the function that it is given to has no user data for it, it is also passed data, last.

This callback type is used by file:measure-disk-usage to make periodic progress reports when measuring the amount of disk spaced used by a directory.

These calls are made on a best-effort basis and not all types of <GFile> will support them. At the minimum, however, one call will always be made immediately.

In the case that there is no support, reporting will be set to #f (and the other values undefined) and no further calls will be made. Otherwise, the reporting will be #t and the other values all-zeros during the first (immediate) call. In this way, you can know which type of progress UI to show without a delay.

For file:measure-disk-usage the callback is made directly. For g_file_measure_disk_usage_async() the callback is made via the default main context of the calling thread (ie: the same way that the final async result would be reported).

current-size is in the same units as requested by the operation (see apparent-size).

The frequency of the updates is implementation defined, but is ideally about once every 200ms.

The last progress callback may or may not be equal to the final result. Always check the async result to get the final value.

reporting

Passed: a boolean.

#t if more reports will come

current-size

Passed: an unsigned 64-bit integer.

the current cumulative size measurement

num-dirs

Passed: an unsigned 64-bit integer.

the number of directories visited so far

num-files

Passed: an unsigned 64-bit integer.

the number of non-directory files encountered

data

Not passed: it is the user data that guile-gi supplied.

the data passed to the original request for this callback