File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ mod utils;
99mod walk;
1010
1111fn main ( ) {
12- let CliArgs { path, buf_size } = dbg ! ( parse_cli_args( ) ) ;
12+ let CliArgs { path, buf_size } = parse_cli_args ( ) ;
1313
1414 let mut buf = vec ! [ 0u8 ; buf_size] ;
1515
Original file line number Diff line number Diff line change @@ -13,11 +13,17 @@ pub struct ReadSizes {
1313}
1414
1515pub fn read_path < P : AsRef < Path > > ( path : P , buf : & mut Vec < u8 > ) -> ReadSizes {
16- let metadata = fs:: metadata ( & path) . unwrap ( ) ;
16+ let metadata = fs:: symlink_metadata ( & path) . unwrap ( ) ;
1717 if metadata. is_dir ( ) {
1818 read_directory ( & path, buf)
1919 } else if metadata. is_file ( ) {
2020 read_file ( & path, buf)
21+ } else if metadata. is_symlink ( ) {
22+ eprintln ! ( "Ignoring symlink {:?}" , path. as_ref( ) ) ;
23+ ReadSizes {
24+ metadata_size : 0 ,
25+ actual_size : 0 ,
26+ }
2127 } else {
2228 eprintln ! (
2329 "Error: {:?} has unsupported file type. Only directories and plain files." ,
You can’t perform that action at this time.
0 commit comments