On Mon, Nov 17, 2003 at 11:11:36AM +0100, Remi Vanicat wrote:
> <sylvain.le-gall@...> writes:
> > Hello,
> >> It's very interesting.
> >> Some possible amelioration :
> >> - What Is_newer_than mean exactly, what are those 2 string?
> > The two strings are filename
> I mean, I understood what is the result of the test Exists apply to
> the filename "foo". I don't understood what is the result of the test
> (Is_newer_than ("bar", "quux")) apply to the filename "foo".
Ok, i see your point... In fact, it is not a real API of mine, the test
is here because it is in the exec "test", that you can found of unix.
Basically, i took the man of "test" and reimplement it as it is...
But i can extend it...
For example : Is_newer_than_date(x) can be a good test also.
> >> - a Is_bigger_than of int and a Is_smaller_than of int could be
> >> useful;
> > I treat of file not of int, i don't want to get <, >, <=, >= in my
> > library ( but if you insist, it is not very complicated to add this test
> > ).
> The idea was to compare the size of the file with an number of octet
> (or any other size measurement that could be useful).
Well perfect, what about Is_bigger_than_size(x), Is_smaller_than_size(x),
Is_equal_to_size(x) with x of type
type file_size =
TO of int
| GO of int
| MO of int
| KO of int
| O of int
And rounding to the the same unit.
> >> - for the newer and older, It could be useful to give a date
> >> directly;
> > And the date problem arise : yes but which date ( actually ocaml std
> > library only provide timestamp conversion... ).
> I agree there. As I've understood, you use the Unix.stat function for
> your implementation, so I would use the same format than the st_?time
> field of the stats type.
I prefer not to implement directly the size field, which doesn't speak
too much too me... But it is an option
> >> - I would use : Or of test_file list and And of test_file list;
> > Yes.... Think, i'll keep And/Or and add AndList/OrList
> Well, it is not so important, just a preference of mine.
Preference is very interesting... Because i would to have some people
using my lib ;->
The discussion is totally open, my lib is at an early stage of dev and i
would like to have suggestion ( i don't defend the actual layout of the
lib which was at first and adhoc lib for some dev of mine ).
Sylvain LE GALL