Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] ocaml magic file ...
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Sven <luther@d...>
Subject: [Caml-list] ocaml magic file ...
Hello, ...

I have this small magic file (to put in /etc/magic) for file to recognize the
various .cm* file types.

here it is :

-------- cut here --------------
# Magic local data for file(1) command.
# Insert here your local magic data. Format is described in magic(5).
0	string	Caml1999	Objective Caml
>8      string  X		exec file
>8	string	I		interface file\ (*.cmi)
>8	string	O		object file\ (*.cmo)
>8	string	A		library file\ (*.cma)
>8	string	Y		native object file\ (*.cmx)
>8      string  Z		native library file\ (*.cmxa)
>8      string  M		'ast_impl' file
>8      string  N		'ast_intf' file
>9	string	>\0		(Version %3.3s).
-------- cut here --------------

It gives this kind of output for the various ocaml kind of files i know of.

 digest.cmi: Objective Caml interface file\ (*.cmi) (Version 008).
 profiling.cmo: Objective Caml object file\ (*.cmo) (Version 004).
 dynlink.cma: Objective Caml library file\ (*.cma) (Version 006).
 random.cmx: Objective Caml native object file\ (*.cmx) (Version 006).
 bigarray.cmxa: Objective Caml native library file\ (*.cmxa) (Version 008).

I don't really know what the ast_impl, the ast_intf and the exec
file type are all about, so these may not be the best strings around.

I plan to sent this to the maintainer of the debian package including the file
utility, and would like other people to review it, just to see if i did a very
big mistake somewhere.

Also, feel free to move it to your /etc/magic, or to use it for any other kind
of use.

Friendly,

Sven Luther
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr