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
use std::fs::OpenOptions;
use exfat_fs::dir::Root;
fn main() {
// let size: u64 = 32 * MB as u64;
// let hello_label = Label::new("Hello".to_string()).unwrap();
// let format_options = FormatVolumeOptionsBuilder::default()
// .pack_bitmap(false)
// .full_format(false)
// .dev_size(size)
// .label(hello_label)
// .bytes_per_sector(512)
// .build()
// .unwrap();
// let formatter = Exfat::try_from(format_options).unwrap();
let file = OpenOptions::new()
.write(true)
.read(true)
.create(true)
.truncate(false)
.open("test")
.unwrap();
// formatter.write(&mut file).unwrap();
let mut root = Root::open(file).unwrap();
let len = root.items().len();
println!(
"Root directory parsed! Volume Label: `{}`, Number of items: `{}`",
root.label().unwrap(),
len
);
}