#flatten #directory #target-directory #recursion #remove

bin+lib flatten-directory

move all files from sub-directories to target directory, then remove all directories recursively

1 stable release

1.0.0 Oct 14, 2024

#1065 in Filesystem

MIT license

7KB
80 lines

Flatten directory

  1. move all files from sub-folders to target directory

  2. then remove all directories recursively

Install

cargo install flatten-directory

Usage

Command Line

flatten-directory .
flatten-directory "/mnt/d/download"

Use as library

Basic

use flatten_directory::FlattenDirectory;

fn main() {
    FlattenDirectory::new("/tmp/test".into()).execute().unwrap();
}

Dependencies

~1.3–8.5MB
~69K SLoC