[
Lists Home |
Date Index |
Thread Index
]
On Fri, 2002-06-28 at 00:17, Thomas B. Passin wrote:
> [Eric van der Vlist
> >
> > If you are happy with the result of the unix "file" command to determine
> > the type of a text and see if it's more likely a Java source code, a
> > snippet of Python or an English text, you may want to validate the
> > document using its result instead of the code.
> >
> You mean, try to compile and if it compiles, it's in that language? But
> you can't be sure abouta file iwth a bug that prevents compiling. How to
> handle that?
No, I meant using the unix "file" command which try to guess the "type"
of a file using "magic numbers":
vdv@ibook:~/wikiml/code/experimental/java$ file README
README: ASCII English text
vdv@ibook:~/wikiml/code/experimental/java$ file WikiSAXWriter.java
WikiSAXWriter.java: ASCII Java program text
but also:
vdv@ibook:~/4xt/pub/downloads/JrdfDB$ file Test.java
Test.java: ASCII C program text, with very long lines
Like with any magic, it's not 100% sure and can sometimes be confused
like here between Java and C but it's usually working fine!
Eric
--
See you in San Diego.
http://conferences.oreillynet.com/os2002/
------------------------------------------------------------------------
Eric van der Vlist http://xmlfr.org http://dyomedea.com
(W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema
------------------------------------------------------------------------
|