You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
path is just a Path to a small text file named /tmp/PFZ6827520388559156905.txt with contents some text. If I'm using the built-in magic.mime file (i.e. I remove the argument to the constructor), info is null. If I use my magic.mime file (which I got from cloning https://github.com/file/file/ and concatenating all files in magic/Magdir) - info is not null, but rather: (NES, type OTHER, msg '(NES 2.0): 32x16k PRG, 116x8k CHR [V-mirror] [Trainer]' (that's the toString) and the mime type is null.
I'm not sure what's going on and what I'm doing wrong. It also doesn't work for .ods file (application/vnd.oasis.opendocument.spreadsheet), .docx (application/vnd.openxmlformats-officedocument.wordprocessingml.document, it returns application/zip), etc. For all of these the file command works fine. Where am I making a mistake? Isn't this library supposed to return the same things as the file command?
The text was updated successfully, but these errors were encountered:
Actually now I tried using the constructor which accepts an ErrorCallBack argument - and there are a million errors when parsing the magic.mime file that I've made using the steps I mentioned above. I'm not sure where can I get a workingmagic.mime file from. Can you please elaborate on this also?
The file command has additional checking that is not magic number based. For example the ods files are zip files. To understand that they are spreadsheets requires opening up the zip file and interrogating its contents. This is same for text files which have no magic numbers. That said, I have a todo entry to start adding these specific type investigations.
Hi, I'm trying the library like this:
path
is just a Path to a small text file named/tmp/PFZ6827520388559156905.txt
with contentssome text
. If I'm using the built-inmagic.mime
file (i.e. I remove the argument to the constructor),info
is null. If I use mymagic.mime
file (which I got from cloning https://github.com/file/file/ and concatenating all files inmagic/Magdir
) -info
is not null, but rather:(NES, type OTHER, msg '(NES 2.0): 32x16k PRG, 116x8k CHR [V-mirror] [Trainer]'
(that's thetoString
) and the mime type is null.I'm not sure what's going on and what I'm doing wrong. It also doesn't work for
.ods
file (application/vnd.oasis.opendocument.spreadsheet
),.docx
(application/vnd.openxmlformats-officedocument.wordprocessingml.document
, it returnsapplication/zip
), etc. For all of these thefile
command works fine. Where am I making a mistake? Isn't this library supposed to return the same things as thefile
command?The text was updated successfully, but these errors were encountered: