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

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Remi Vanicat <remi.vanicat@l...>
Subject: Re: [Caml-list] unix.chop_extension
Xavier Leroy <xavier.leroy@inria.fr> writes:

[...]


>> There's one extra thing I'd like to point out. We have the 
>> chop_extension function. Why in the world is there no find_extension 
>> function?
>> find_extension "foo.bar" --> "bar"
>
> Why in the world would that be generally useful?  Remember, we don't
> shoot for completeness (it's unattainable anyway), just for
> usefulness.

Well, it usefull when one want to use a different parser (or more
generally a different "file reader) for different type file (gif,
jpg,...), or launch a different helper program for different type of
file. (Well, I agree that the usage of a "magic number" is a better
way to do it, but the usage of the extension is easier).

-- 
Rémi Vanicat

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners