#let #directory #file #create #remove #path #basic #clean-up #create-directory #brute


A simple library that makes dealing with Rust file system a breeze

2 unstable releases

0.2.0 Dec 20, 2021
0.1.9 Dec 14, 2021
0.1.5 Nov 30, 2021
0.0.9 Nov 23, 2021
0.0.0 Oct 28, 2021

#790 in Filesystem

Download history 14/week @ 2023-07-28 14/week @ 2023-08-04 37/week @ 2023-08-11 15/week @ 2023-08-18 52/week @ 2023-08-25 32/week @ 2023-09-01 17/week @ 2023-09-08 17/week @ 2023-09-15 7/week @ 2023-09-22 13/week @ 2023-09-29 15/week @ 2023-10-06 16/week @ 2023-10-13 18/week @ 2023-10-20 61/week @ 2023-10-27 35/week @ 2023-11-03 23/week @ 2023-11-10

141 downloads per month
Used in 3 crates


1.5K SLoC


A simple library that makes dealing with Rust file system a breeze.

Brown library exports helpful functions which gives you a very simple API for creating managin and manipulating files,folder etc in the current working folder.

  • The API is almost final. I do not see any major changes in it.
  • More tests will be added and code will be improved; other than that the lib is complete.
  • Keep in mind that thorugh out this library you do not need to add "./" anywhere in the path, it is added automatically. However if you do add "./" before the path that does not cause an error now (in past version it did).
  • The word folder" and "directory" are used interchangebaly;there is no difference between a "folder" and "directory" in the documentation. They are both same.*


use brown;

pub fn main(){
  // create a folder (parent folder) for rest of the tests
  let p_dir = brown::create_dir("parent");

  // create file safely
  let md_file = brown::create_file("parent/md_file.md");
  // Will over write a file even if exists already.
  let html_file = brown::create_file_brute("parent/html_file.html");
  // create a folder inside previously created parent folder 
  let test_folder = brown::create_dir("parent/test_folder");

  // This will just get the files from the given folder root.It returns a Vec of DirEntry objects (std::fs::DirEntry). Many fn in this lib consume DirEntry object.  
  let all_files = brown::get_files("parent");
  // This will just get the folders from the given folder root. 
  let all_dirs = brown::get_dirs("parent");
  // This will just get the files with .md extention from the given folder root.
  let all_md_files = brown::get_files_by_ext("parent","md");
  // This will get all entries from a folder
  let all_entries = brown::get_entries("parent");


Incase you have any issues with the library, let me know here https://github.com/skillzaa/brown/issues

Please be in touch

My twitter handle is :: @rusthulk


~19K SLoC