Hole-Punch
A simple, cross platform crate for finding the locations of holes in sparse files.
Forked from Nathan McCarty's hole_punch (git)
Currently supports Unix-like platforms that support the SEEK_HOLE and SEEK_DATA commands on lseek, as well as windows.
The operating systems that currently support filesystem-level sparsity information are:
- Linux
- Android
- FreeBSD
- Windows
- MacOS
These are currently implemented with a compile time switch, and SparseFile::scan_chunks will always immediately return with a ScanError::UnsupportedPlatform error on platforms not on this list.
Usage
use File;
use *;
let mut file = open;
let segments = file.scan_chunks.expect;
for segment in segments
License
Hole-Punch is distributed under your choice of the MIT license, or Apache 2.0.