rc/catar/chunker.rs: first try

This commit is contained in:
Dietmar Maurer
2018-12-31 13:01:06 +01:00
parent bf205f94c5
commit 1c287cb19a
3 changed files with 231 additions and 5 deletions

View File

@ -11,6 +11,7 @@ use proxmox_backup::api::router::*;
//use proxmox_backup::backup::image_index::*;
//use proxmox_backup::config::datastore;
use proxmox_backup::catar::encoder::*;
use proxmox_backup::catar::chunker::*;
use proxmox_backup::backup::datastore::*;
use serde_json::{Value};
@ -37,11 +38,13 @@ fn backup_dir(
}
// fixme: implement chunked writer
let writer = std::fs::OpenOptions::new()
.create(true)
.write(true)
.truncate(true)
.open("mytest.catar")?;
// let writer = std::fs::OpenOptions::new()
// .create(true)
// .write(true)
// .truncate(true)
// .open("mytest.catar")?;
let writer = Chunker::new(chunk_size);
let path = std::path::PathBuf::from(path);