Re: identify the file type

From: Axel Naumann <Axel.Naumann_at_cern.ch>
Date: Mon, 23 May 2011 09:16:53 +0200


Hi,

even though I don't see how this is related to ROOT: you could check whether the file starts with "<?xml". XML files don't *have* to, but they should, and most do.

Cheers, Axel.

On 5/22/11 12:52 PM, Adrian Sevcenco wrote:
> 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.
> Thank you,
> Adrian
>
> ----------------------------------------------
> Adrian Sevcenco |
> Institute of Space Sciences - ISS, Romania |
> adrian.sevcenco at {cern.ch,spacescience.ro} |
> ----------------------------------------------
>
Received on Mon May 23 2011 - 09:16:57 CEST

This archive was generated by hypermail 2.2.0 : Mon May 23 2011 - 17:50:01 CEST