Crates.io | finder_info |
lib.rs | finder_info |
version | 0.2.3 |
source | src |
created_at | 2018-02-16 02:46:47.050031 |
updated_at | 2021-08-06 22:09:37.601176 |
description | A library to parse Apple HFS/HFS+/APFS FinderInfo attribute. |
homepage | |
repository | https://github.com/dropbox/finderinfo-rust |
max_upload_size | |
id | 51360 |
size | 30,230 |
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.
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);