Skip to main content

file_sorting

Function file_sorting 

Source
pub fn file_sorting<P: AsRef<Path>>(
    origin: P,
    destination: P,
    depth: u8,
) -> Result<FileSortingResults>
Expand description

Sort files by file type by creating a directory based on the file type and making a symbolic link to the original file, so no files are actually deleted.

The find and file commands can be used to verify: find . -type f -exec file {} \;

The file command will not be 100% correct, and neither will we.

ยงErrors

An error occurs if files cannot be read or if symbolic links cannot be created in newly-created directories based on file type.