[LIP] Using libmagic to check file type
Kumar Appaiah <[email protected]>
| Newsgroups | gmane.user-groups.linux.india.programmers |
|---|---|
| Message-ID | <[email protected]> |
Dear LIP, I wish to use libmagic to verify whether the file I am currently scanning is of a particular type. One possible way (which I've seen being used) is to get the string which libmagic returns, and see if it matches the pattern I expect. Is there a more "correct" way of matching, say with an enumeration of file types and matching against that, or is the former method the way it should be done? Thanks. Kumar ------------------------------------------------------------------------------ Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge