I decided to learn Zig a couple of weeks ago and realized my starting project required identifying file types (in particular, if a file is a text/binary file). I found some libraries around (including libmagic) but could not find anything written purely in Zig (probably because I didn’t search well enough). So, I wrote zmime (GitHub - avac74/zmime: A dependency‑free file type detection library written in Zig.)
This is pretty much my first (real) project with Zig. Any suggestions to improve functionality and to make the code more idiomatic are very much welcomed!
This is fantastic! I was looking at using libmagic for my project a few days ago but shelved it since I didn’t wanna deal with translateC at the time. Will for sure try it out once I have some time.