wip
This commit is contained in:
parent
59d01d04db
commit
48817d1df8
6 changed files with 58 additions and 10 deletions
|
|
@ -2,6 +2,7 @@ use std::io;
|
|||
use std::io::{Cursor, Read, Seek, SeekFrom, Write};
|
||||
|
||||
use crate::compression::CompressionMethod;
|
||||
use crate::data_descriptor::DataDescriptor;
|
||||
use crate::end_of_central_directory::{
|
||||
EndCentralDirectory, Zip64EndCentralDirectory, Zip64EndCentralDirectoryLocator,
|
||||
};
|
||||
|
|
@ -63,6 +64,7 @@ impl<T: Write> ZipFileWriter<T> {
|
|||
file: &mut U,
|
||||
mut header: FileHeader,
|
||||
local_header: Option<LocalFileHeader>,
|
||||
data_descriptor: Option<DataDescriptor>,
|
||||
) {
|
||||
assert!(header.general_purpose_flags & general_purpose_flags::MASK_ENCRYPTED == 0);
|
||||
assert!(
|
||||
|
|
@ -192,9 +194,13 @@ impl<T: Write> ZipFileWriter<T> {
|
|||
header.general_purpose_flags &= !(general_purpose_flags::MASK_COMPRESS_OPTION_1
|
||||
| general_purpose_flags::MASK_COMPRESS_OPTION_2);
|
||||
|
||||
if data_descriptor.is_some() {
|
||||
panic!("Writing file with data_descriptor is not yet implemented");
|
||||
}
|
||||
let file_info = FileInfo {
|
||||
local_header,
|
||||
header,
|
||||
data_descriptor,
|
||||
};
|
||||
self.files.push(file_info);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue