The Toc class is the return value of class method results and collect of class Walk.
dirslist of directory names.fileslist of filenames.symlinkslist of symlink names.otherlist of names of all other entry types.errorslist of access errors (list of strings).
Creates a class instance for getting the file tree. 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.sortediftruealphabetically sort results.skip_hiddeniftruethen ignore all hidden files and directories.max_depthis maximum depth of iteration. If0then depth 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.storestore results in local structure.
For valid file patterns see module glob.
ReturnType::Basereturndirsandfilesasos.walkdoes.ReturnType::Extreturn additional data:symlinks,otheranderrors.
Please note:
Due to limitations of jwalk the returned errors just contain the error message without any information to which files the errors correspond to.
Return results in sorted order.
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 parsing the directory tree in background. Raises an exception if a task is already running.
Wait for parsing task to finish.
Stop parsing task.
Calculate statistics and return a Toc object when the task has finished. This method is blocking.
If only_new is true this method returns true if new results are available,
If only_new is false this method returns true if results are available,
If only_new is true this method returns number of new results,
If only_new is false this method returns number of total results,
If only_new is true this method returns new results,
If only_new is false this method returns total results,
Returns true if errors occured while scanning the directory tree. The errors can be found in the statistics object.
Returns number of errors occured while scanning the file tree.
Returns the errors.
Returns the results serialized with speedy.
For this method the feature speedy needs to be enabled.
Returns the results serialized with bincode.
For this method the feature bincode needs to be enabled.
Returns the results serialized as json.
For this method the feature json needs to be enabled.
Returns the statistics of the results. Please note that file types other are counted in member devices.
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.