# Gem for Mac HFS metadata?

**URL:** <https://www.ruby-forum.com/t/gem-for-mac-hfs-metadata/179635>\
**Category:** Ruby\
**Created:** [November 30, 2009, 10:33pm UTC](https://www.ruby-forum.com/t/gem-for-mac-hfs-metadata/179635 "2009-11-30T22:33:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fritza](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/5f9b8f/32.png) [@fritza](https://www.ruby-forum.com/u/fritza)\
**Post date:** [November 30, 2009, 10:33pm UTC](https://www.ruby-forum.com/t/gem-for-mac-hfs-metadata/179635/1 "2009-11-30T22:33:34Z")

</div>

Mac OS X’s native HFS file system attaches directory metadata to its  
files. The most notable are the “type” and “creator” codes which  
identify file types without resort to name extensions, and bind them to  
their preferred editors.

My Ruby application needs to examine HFS metadata. I’ve tried Googling  
every keyword I can think of, but all I get are false positives.

Is there a gem that will do this for me?

```
â€” F
```

---

<div class="post-metadata">

**Author:** ![fritza](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/5f9b8f/32.png) [@fritza](https://www.ruby-forum.com/u/fritza)\
**Post date:** [November 30, 2009, 11:12pm UTC](https://www.ruby-forum.com/t/gem-for-mac-hfs-metadata/179635/2 "2009-11-30T23:12:39Z")

</div>

A gem would be great (I personally don’t know of any), but you could  
write a  
wrapper for mdls at a pinch. It’s output is kinda nice (in terms of  
things  
to parse) e.g.

kMDItemContentModificationDate = 2009-11-27 07:06:38 +1100  
kMDItemContentType = “public.svg-image”  
kMDItemContentTypeTree = (  
“public.svg-image”,  
“public.image”,  
“public.data”,  
“public.item”,  
“public.content”  
)
