5 releases

0.2.3 Aug 6, 2021
0.2.2 Feb 16, 2021
0.2.1 May 13, 2020
0.2.0 Aug 31, 2018
0.1.0 Feb 16, 2018

#170 in macOS and iOS APIs

25 downloads per month
Used in finder_info_bin

Apache-2.0

30KB
656 lines

finderinfo

A library to parse Apple HFS/HFS+/APFS FinderInfo attribute.

On modern MacOS systems, objects in the filesystem can have an extended attribute called com.apple.FinderInfo. This attribute is 32 bytes long and largely undocumented. It turns out that this attribute is actually the old HFS Finder Info struct in the first 16 bytes, and the Extended Finder Info struct in the second 16 bytes. This library provides a mechanism by which a Rust program can programmatically interact with these structures.

This crate also provides an executable finderinfo, which is a small utility that can parse and display the contents of the Finder Info blob. If built with the xattr feature, the library is able to read and write the com.apple.FinderInfo extended attribute on MacOS systems.

Example

let buf = vec![
    0x00u8, 0x00u8, 0x00u8, 0x00u8, 0x00u8, 0x00u8, 0x00u8, 0x00u8,
    0x40u8, 0x00u8, 0x00u8, 0x00u8, 0x00u8, 0x00u8, 0x00u8, 0x00u8,
    0x00u8, 0x00u8, 0x00u8, 0x00u8, 0x00u8, 0x00u8, 0x00u8, 0x00u8,
    0x00u8, 0x00u8, 0x00u8, 0x00u8, 0x00u8, 0x00u8, 0x00u8, 0x00u8,
];
let finder_info = FinderInfoFolder::read(&mut io::Cursor::new(buf));
println!("{:?}", finder_info);

Dependencies

~115KB