Describe the bug
Using raw_copy_file on directory or symbol link make external file attributes changed to regular file
To Reproduce
fn raw_copy_dir() {
let mut input = {
let mut b = zip::ZipWriter::new(std::io::Cursor::new(Vec::new()));
b.add_directory("dir", zip::write::FileOptions::DEFAULT)
.unwrap();
b.finish_into_readable().unwrap()
};
let mut copied = {
let mut b = zip::ZipWriter::new(std::io::Cursor::new(Vec::new()));
b.raw_copy_file(input.by_index(0).unwrap()).unwrap();
b.finish_into_readable().unwrap()
};
{
let f = copied.by_index(0).unwrap();
println!("{:o}", f.unix_mode().unwrap()); // changes to 0o100755
}
}
Expected behavior
External file attributes should be preserved by raw_copy_file
Describe the bug
Using
raw_copy_fileon directory or symbol link make external file attributes changed to regular fileTo Reproduce
Expected behavior
External file attributes should be preserved by
raw_copy_file