#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

#806 in Filesystem

Download history 170/week @ 2024-10-13 6/week @ 2024-10-20 4/week @ 2024-11-03

180 downloads per month

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–8MB
~71K SLoC