blackwinter / ruby-filemagic

Ruby bindings to the magic(4) library, revised.
https://blackwinter.github.iom/ruby-filemagic
146 stars 34 forks source link

Using non-default magic database/files #16

Closed jipis closed 9 years ago

jipis commented 9 years ago

The file command allows (using the "-m" flag) the use of different magic files than the default. I don't believe that this is currently available from ruby using this gem. This functionality does exist in libmagic, though. I'm not fully up on it, but it seems like the call is to magic_load.

blackwinter commented 9 years ago

You can set the MAGIC environment variable or call FileMagic#load with your custom magic file.