simplify pxar module structure

This commit is contained in:
Dietmar Maurer
2019-03-15 08:24:32 +01:00
parent 1ef46b81d3
commit 3dbfe5b142
6 changed files with 22 additions and 18 deletions

View File

@ -11,7 +11,7 @@ use nix::fcntl::OFlag;
use nix::sys::stat::Mode;
use nix::dir::Dir;
use crate::pxar::encoder::*;
use crate::pxar;
/// Stream implementation to encode and upload .pxar archives.
///
@ -44,7 +44,7 @@ impl PxarBackupStream {
let child = thread::spawn(move|| {
let mut writer = unsafe { std::fs::File::from_raw_fd(tx) };
if let Err(err) = PxarEncoder::encode(path, &mut dir, &mut writer, all_file_systems, verbose) {
if let Err(err) = pxar::Encoder::encode(path, &mut dir, &mut writer, all_file_systems, verbose) {
eprintln!("pxar encode failed - {}", err);
}
});

View File

@ -5,7 +5,7 @@ use std::os::unix::io::FromRawFd;
use std::path::{Path, PathBuf};
use std::io::Write;
use crate::pxar::decoder::*;
use crate::pxar;
/// Writer implementation to deccode a .pxar archive (download).
@ -31,7 +31,7 @@ impl PxarDecodeWriter {
let child = thread::spawn(move|| {
let mut reader = unsafe { std::fs::File::from_raw_fd(rx) };
let mut decoder = PxarDecoder::new(&mut reader);
let mut decoder = pxar::SequentialDecoder::new(&mut reader);
if let Err(err) = decoder.restore(&base, & |path| {
if verbose {