Gpt
A pure rust GPT header/partition table library
Install / Use
/learn @Quyzi/GptREADME
gpt
A pure-Rust library to work with GPT partition tables.
gpt provides support for manipulating (R/W) GPT headers and partition
tables. It supports any that implements the Read + Write + Seek + Debug traits.
Example
use std::error::Error;
fn main() {
// Inspect disk image, handling errors.
if let Err(e) = run() {
eprintln!("Failed to inspect image: {}", e);
std::process::exit(1)
}
}
fn run() -> Result<(), Box<dyn Error>> {
// First parameter is target disk image (optional, default: fixtures sample)
let sample = "tests/fixtures/gpt-disk.img".to_string();
let input = std::env::args().nth(1).unwrap_or(sample);
// Open disk image.
let cfg = gpt::GptConfig::new().writable(false);
let disk = cfg.open(input)?;
// Print GPT layout.
println!("Disk (primary) header: {:#?}", disk.primary_header());
println!("Partition layout: {:#?}", disk.partitions());
Ok(())
}
Related Skills
node-connect
349.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.5kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
