fn pack_vpk(addlist: Vec<AddList>, vpk_path: &Path) -> zip::result::ZipResult<()> {
    use std::io::prelude::*;
    use zip::{write::FileOptions, CompressionMethod::Stored, ZipWriter};

    // Variable that will manage ZipWriter (Zip Archive Generator) to write our
    // vpk file
    let mut vpk_writer: ZipWriter<File>;
    let mut file_buff = Vec::new();
    let options: FileOptions;
    // Variable that will allow to create and write to our new vpk file
    let vpk_file: File;

    vpk_file = make_file(vpk_path);
    vpk_writer = ZipWriter::new(vpk_file);
    options = FileOptions::default()
        .compression_method(Stored)
        .unix_permissions(0o755);

    for pair in addlist {
        let mut file = File::open(&pair.src)?;
        file.read_to_end(&mut file_buff)?;
        vpk_writer.start_file(&pair.dst, options)?;
        vpk_writer.write_all(&*file_buff)?;
        file_buff.clear();
    }
    vpk_writer.finish()?;
    Ok(())
}
/// Function that will make the VPK archive with all the required files
///
/// This is the final step of vita-pack-vpk. It returns nothing.
Function that will make the VPK archive with all the required files
This is the final step of vita-pack-vpk. It returns nothing.
Function that will make the VPK archive with all the required files This is the final step of vita - pack - vpk . It returns nothing .
fn pack_vpk(addlist: Vec<AddList>, vpk_path: &Path) -> zip::result::ZipResult<()> {
    use std::io::prelude::*;
    use zip::{write::FileOptions, CompressionMethod::Stored, ZipWriter};
    // Variable that will manage ZipWriter (Zip Archive Generator) to write our
    // vpk file
    let mut vpk_writer: ZipWriter<File>;
    let mut file_buff = Vec::new();
    let options: FileOptions;
    // Variable that will allow to create and write to our new vpk file
    let vpk_file: File;
    vpk_file = make_file(vpk_path);
    vpk_writer = ZipWriter::new(vpk_file);
    options = FileOptions::default()
        .compression_method(Stored)
        .unix_permissions(0o755);
    for pair in addlist {
        let mut file = File::open(&pair.src)?;
        file.read_to_end(&mut file_buff)?;
        vpk_writer.start_file(&pair.dst, options)?;
        vpk_writer.write_all(&*file_buff)?;
        file_buff.clear();
    }
    vpk_writer.finish()?;
    Ok(())
}
fn pack_vpk ( addlist : Vec < AddList > , vpk_path : & Path ) -> zip :: result :: ZipResult < ( ) > { use std :: io :: prelude :: * ; use zip :: { write :: FileOptions , CompressionMethod :: Stored , ZipWriter } ; // Variable that will manage ZipWriter (Zip Archive Generator) to write our // vpk file let mut vpk_writer : ZipWriter < File > ; let mut file_buff = Vec :: new ( ) ; let options : FileOptions ; // Variable that will allow to create and write to our new vpk file let vpk_file : File ; vpk_file = make_file ( vpk_path ) ; vpk_writer = ZipWriter :: new ( vpk_file ) ; options = FileOptions :: default ( ) . compression_method ( Stored ) . unix_permissions ( 0o755 ) ; for pair in addlist { let mut file = File :: open ( & pair . src ) ? ; file . read_to_end ( & mut file_buff ) ? ; vpk_writer . start_file ( & pair . dst , options ) ? ; vpk_writer . write_all ( & * file_buff ) ? ; file_buff . clear ( ) ; } vpk_writer . finish ( ) ? ; Ok ( ( ) ) }
Function that will make the VPK archive with all the required files
This is the final step of vita-pack-vpk.
Function that will make the VPK archive with all the required files This is the final step of vita - pack - vpk .
addlist
Vec<AddList>
vpk_path
&Path
addlist
Vec<AddList>
vpk_path
&Path