pub fn guess_path(path: impl AsRef<Path>) -> Result<FormatId>Expand description
Guesses the authoritative format for a given filesystem path.
ยงExamples
use ctb_formats_detection::{guess_path, FormatId, OsPath};
let dir = tempfile::tempdir()?;
let path: OsPath = dir.path().join("archive.tar.gz");
std::fs::write(&path, [0x1F, 0x8B, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00])?;
let format = guess_path(&path)?;
assert_eq!(format, FormatId::Gzip);