This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use anyhow::Result; | |
use clap::Parser; | |
use futures::TryStreamExt; | |
use indicatif::{MultiProgress, ProgressBar, ProgressStyle}; | |
use indicatif_log_bridge::LogWrapper; | |
#[allow(unused_imports)] | |
use log::{error, info}; | |
use std::sync::Arc; | |
use tokio::fs::File; | |
use tokio::io::{AsyncWriteExt, BufReader, BufWriter}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// use file api | |
use anyhow::Result; | |
use std::fs::OpenOptions; | |
use std::io::{self, Write, Seek, SeekFrom}; | |
use std::thread; | |
fn write_to_file_at_position(file_path: &str, data: &[u8], position: u64) -> io::Result<()> { | |
// Open the file in write mode and create it if it doesn't exist | |
let mut file = OpenOptions::new() | |
.write(true) |