Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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 <> 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 "" --> "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 Archives:
Bug reports: FAQ:
Beginner's list: