Expand description
§dir_cleaner
A simple binary crate written in order to learn how to create,
organize and distribute Rust apps.
The main purpose of the crate is to help you identify duplicate files in nested directories and simplify their deletion (if necessary).
The crate is super simple to use, just call it from the
command line and provide the relative path of the folder
you want to inspect.
dir_cleaner ./testOnce you’ve done so, the program will ask you for a file name;
such a name will be used to find any file with that exact
name on the specified directory and its respective subdirectories.
Then, the program will proceed to expose the list of the
found files (along with their creation_date and their relative path) and ask you if you want to keep all of them,
if that’s not the case it will help you with the deletion process.
Structs§
- File
- Stores relevant information (and some
metadata) associated with a specific file, in order to simply its manipulation atfs-level(E.G: Access, Deletion, Modification).
Functions§
- get_
dir_ files - Recursively traverses the directory located in the provided
pathand its respective subdirectories, in order to gather the information of the files that have the providedfile_nameand collect it into aVecofFiles. - get_
input - Prints the provided
messagetostdoutand proceeds to get userinput. - run
- Proceeds to gather the
fileslocated on the directory represented by thepathspecified throughargs, as long as they match thenameprovided by the user when prompted to do. Once the information of the differentfilesis collected, the user will have the option tokeepordeleteall of them.