The Statistics class is the return value of class methods results and collect of class Count.
dirscontains number of directories.filescontains number of files.slinkscontains number of symlinks.hlinkscontains number of hardlinks.devicescontains number of devices (only relevant on Unix systems).pipescontains number of named pipes (only relevant on Unix systems).sizecontains total size of all files.usagecontains total usage on disk.errorslist of access errors (list of strings).durationtime taken for scanning (in seconds as a float).
Creates a class instance for calculating statistics. The class instance initially does nothing. To start the scan either the method start or the method collect has to be called.
root_pathis directory to scan.~is allowed on Unix systems.skip_hiddeniftruethen ignore all hidden files and directories.max_depthis maximum depth of iteration. If0then depth limit is disabled.max_file_cntis maximum number of files to collect. If0then limit is disabled.dir_includelist of patterns for directories to include.dir_excludelist of patterns for directories to exclude.file_includelist of patterns for files to include.file_excludelist of patterns for files to exclude.case_sensitiveiftruethen do case sensitive pattern matching.return_typedefines type of data returned.
For valid file patterns see module glob.
ReturnType::Basecalculate statistics fordirs,files,slinks,sizeandusage.ReturnType::Extin addition to above calculate statistcshlinksand on Unix platformsdevicesandpipes.
skip_hidden(mut self, skip_hidden: bool) -> Self
Set to true to skip hidden (starting with a dot) files.
Set the maximum depth of entries yield by the iterator.
Set maximum number of files to collect.
Set directory include filter.
Set directory exclude filter.
Set file include filter.
Set file exclude filter.
Set case sensitive filename filtering.
Set extended file type counting.
Clear all results.
Start calculating statistics in background. Raises an expception if a task is already running.
Wait for parsing task to finish.
Stop parsing task.
Calculate statistics and return a Statistics object when the task has finished.
Returns true if new statistics are available.
Return a Statistics object with the current statistics.
Returns true if errors occured while scanning the directory tree. The errors can be found in the statistics object.
Returns the duration of the task in seconds as float. As long as the task is running it will return 0.
Returns true after the task has finished.
Returns true while a task is running.