Crates.io | goxoy-file-chunker |
lib.rs | goxoy-file-chunker |
version | 0.0.3 |
source | src |
created_at | 2023-07-18 22:27:14.563284 |
updated_at | 2024-02-25 21:35:14.251681 |
description | Goxoy File Chunker splits files into equal chunks |
homepage | |
repository | https://github.com/Goxoy/goxoy-file-chunker/ |
max_upload_size | |
id | 919795 |
size | 23,619 |
This library was written to split large files into pieces of certain sizes.
// create FileChunk object
let mut file_obj=FileChunk::new();
file_obj.set_storage_path(DefaultStoragePath::TempPath);
// set target file name
file_obj.assign_file("file_name.extension");
if file_obj.is_exist==true{
file_obj.set_size(256,FileChunkType::KiloByte);
let split_result=file_obj.split();
if split_result==true{
println!("chunks ready");
}else{
println!("error accoured");
}
}else{
println!("file does not exist");
}
// create FileChunk object
let mut file_obj=FileChunk::new();
let merge_result=file_obj.merge("path_name");
if merge_result==true{
println!("file merged");
}else{
println!("error accoured");
}