From: <syl...@po...> - 2003-11-16 11:57:21
|
Hello, On Sun, Nov 16, 2003 at 12:34:48PM +0100, Remi Vanicat wrote: > "Sylvain LE GALL" <syl...@po...> writes: > > Hello, > > [...] > > firstly, for both SysUtil.mli and SysPath.mli, I would begin them by > a type filename = string > and replace string by filename where a file name (or directory name) > is waited. > You are right, i will add it to my todo list. > It would make everything clearer. > > > SysUtil.mli : > > > > (** Pattern you can use to test file *) > > type test_file = > > Is_dev_block > > | Is_dev_char > > | Is_dir > > | Exists > > | Is_file > > | Is_set_group_ID > > | Has_sticky_bit > > | Is_link > > | Is_pipe > > | Is_readable > > | Is_writeable > > | Size_not_null > > | Is_socket > > | Has_set_user_ID > > | Is_exec > > | Is_owned_by_user_ID > > | Is_owned_by_group_ID > > | Is_newer_than of string * string > > | Is_older_than of string * string > > | Has_same_device_and_inode of string * string > > | And of test_file * test_file > > | Or of test_file * test_file > > | Not of test_file > > | Match of string > > | True > > | False > > It's very interesting. > Some possible amelioration : > - What Is_newer_than mean exactly, what are those 2 string? The two strings are filename > - 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 ). > - 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 would use : Or of test_file list and And of test_file list; > Yes.... Think, i'll keep And/Or and add AndList/OrList Regard Sylvain LE GALL |