#file-utility #file #utility #elf #detect #executable #utilities

futilities

File utilities, detects image files and elf format (linux executable)

5 releases

0.1.5 Feb 8, 2021
0.1.4 Feb 8, 2021
0.1.3 Feb 8, 2021
0.1.2 Feb 8, 2021
0.1.1 Feb 8, 2021

#30 in #file-utility

Custom license

12KB
226 lines

futilities

A file utility library

This crate provides basic file utilities. Detects image files (PNG, JPEG, SVG, XCF ...) by reading file headers or file information. Also detects ELF format (Linux executables).

Cargo.toml

[dependencies]
futilities = "0.1.5"

Usage

use std::path::Path;
use futilities::*;

fn main() {
	// Use on Path PathBuf String and str
	println!("{:?}", "cargo".is_elf());
	println!("{:?}", Path::new("image.png").is_jpg());
	println!("{:?}", String::new("image.bmp").is_bmp());
	println!("{:?}", "image.svg".is_svg());
}

Not detecting files correctly?

If you suspect that this library doesnt detect a certain file type correctly email me at dylan_w2014@outlook.com with the file type your trying to detect and the file. Or optionally if you think you know why it wouldnt be detected write why. Thank you.

Dependencies

~1.5MB
~21K SLoC