1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
use fs;
use Path;
/// Count the number of folders in a directory recursively.
///
/// # Arguments
///
/// * `path` - A reference to a `Path` representing the directory to count folders for.
///
/// # Returns
///
/// The number of folders found in the directory and its subdirectories.
///
/// # Example
///
/// ```
/// use file_mon::count_folders;
/// use std::path::Path;
///
/// let path = Path::new("/path/to/your/directory");
/// let folder_count = count_folders(path);
/// println!("Number of folders: {}", folder_count);
/// ```