measure_disk_usage
Description:
public virtual bool measure_disk_usage (FileMeasureFlags flags, Cancellable? cancellable, FileMeasureProgressCallback? progress_callback, out uint64 disk_usage, out uint64 num_dirs, out uint64 num_files) throws Error
Recursively measures the disk usage of this.
This is essentially an analog of the 'du' command, but it also reports the number of directories and non-directory files encountered (including things like symbolic links).
By default, errors are only reported against the toplevel file itself. Errors found while recursing are silently ignored, unless
g_file_measure_report_any_error is given in flags.
The returned size, disk_usage, is in bytes and should be formatted with g_format_size in order to get something
reasonable for showing in a user interface.
progress_callback and progress_data can be given to request periodic progress updates while scanning. See the
documentation for FileMeasureProgressCallback for information
about when and how the callback will be invoked.
Parameters:
| this |
a File |
| flags | |
| cancellable |
optional Cancellable |
| progress_callback | |
| disk_usage |
the number of bytes of disk space used |
| num_dirs |
the number of directories encountered |
| num_files |
the number of non-directories encountered |
| progress_data |
user_data for |
Returns:
|
true if successful, with the out parameters set. false otherwise, with throws set. |