Skip to content

Commit

Permalink
fixed handling with empty / unreadable directories
Browse files Browse the repository at this point in the history
  • Loading branch information
ph0llux committed Jan 29, 2024
1 parent 567afde commit a80176e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/file/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ impl FileEncoder {
let buf = match &self.filetype_encoding_information {
FileTypeEncodingInformation::Directory(directory_children) => {
let encoded_directory_children = if directory_children.is_empty() {
Vec::new()
Vec::<u64>::new().encode_directly()
} else {
directory_children.encode_directly()
};
Expand Down
1 change: 1 addition & 0 deletions src/lib/io/zffwriter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,7 @@ fn create_iterator<C: AsRef<Path>>(
warn!("The content of the file {} can't be read, due the following error: {e}.\
The file will be stored as an empty file.", &current_dir.as_ref().display());
file_header.metadata_ext.insert(METADATA_EXT_KEY_UNACCESSABLE_FILE.to_string(), current_dir.as_ref().to_string_lossy().to_string().into());
files.push((current_dir.as_ref().to_path_buf(), file_header));
return Err(e.into());
}
};
Expand Down

0 comments on commit a80176e

Please sign in to comment.