Adrian Sevcenco <Adrian.Sevcenco_at_cern.ch> writes:
> Hi! Is there a way to identify the file type other than using a bash
> command like:
> file -b $file | awk '{print $1}'
>
> I want to distinguish between XML and ASCII file types.
The "file" command is a CLI to libmagic. I've never used it personally but you should be able to link your code against it and use the functions defined in magic.h. Some sparse documentation is in the libmagic(3) man page.
-Brett.
This archive was generated by hypermail 2.2.0 : Mon May 23 2011 - 23:50:02 CEST