Skip to content

Commit

Permalink
more details
Browse files Browse the repository at this point in the history
  • Loading branch information
scx1332 committed Jul 16, 2024
1 parent 280dc7a commit 77dd77f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@ pub fn plan_chunks(chunk_size: u64, file_size: u64) -> anyhow::Result<ChunkPlan>

pub fn realize_plan(plan: ChunkPlan) -> anyhow::Result<()> {
for i in 0..plan.start_chunks {
println!("Output chunk {}", i);
println!("Copy {} bytes", plan.chunk_size);
let dst_chunk_start = i * plan.chunk_size;
let dst_chunk_end = dst_chunk_start * plan.chunk_size;
let src_chunk_start = plan.file_size - ((i + 1) * plan.chunk_size);
let src_chunk_end = plan.file_size + plan.chunk_size;
println!("Output chunk {} - pos {}-{}", i, dst_chunk_start, dst_chunk_end);
println!("Copy {} bytes from {}-{} to {}-{}", plan.chunk_size, src_chunk_start, src_chunk_end, dst_chunk_start, dst_chunk_end);
println!(
"Truncate file to {} bytes",
plan.file_size - ((i + 1) * plan.chunk_size)
Expand Down

0 comments on commit 77dd77f

Please sign in to comment.