get-file-size
get-file-size
is a Rust crate for efficiently determining the size of a file and counting the number of lines within a file asynchronously. This utility is particularly useful in systems where I/O operations need to be non-blocking, elevating performance in concurrent applications or environments where swift, streamlined file operations are essential.
Features
-
Asynchronous File Size Retrieval: Implement utilizing the
GetFileSize
trait, which employs asynchronous methods to fetch file metadata, ensuring minimal blocking during operations. -
Line Counting: An additional function,
count_lines_in_file
, provides the ability to count lines in a file asynchronously.
Usage
Integrate get-file-size
into your project by adding it as a dependency in your Cargo.toml
:
[]
= "0.1.0"
Example
use GetFileSize;
use PathBuf;
use tokio;
async
Contributing
Contributions, bug reports, and feature requests are welcome. Please check the issues page to get involved.
License
This project is dual-licensed under the terms of the MIT license and the Apache License (Version 2.0).