From: <syl...@po...> - 2003-11-15 09:50:57
|
Hello, On Sat, Nov 15, 2003 at 10:34:29AM +0900, Nicolas Cannasse wrote: > > I separate the module in two : > > - SysPath : includes all things which doesn't touch to filesystem ( that > > is the reason why i don't know if it is interessant to have Link ). > > - SysUtil : includes all things which touch the filesystem, so you have to > > be consistent with FS, it is also a try to imitate a lot of Unix command > > like find, which... > > > > For now, it has been tested and it works on Linux ( and the abstract > > SysPath has been tested with Linux FS syntax ). > [...] > > If you have any suggestion... > > This library is under developpement and has no public release yet. But > > if some of you are interested, i will speed up the dev in order to do a > > public release. > > The test_file patterns does not seem very powerful to me : > - for the most obvious cases, like filtering by extension, it can't be used ??? and what about Match(".*\\.cmi") for test ( it really works since i use it ). > - for complex cases, you are limited by the number of test cases. > I think it could be easily remplaced by : > ??? there is no limit about the number of test : And(Match(".*\\.cmi"),Or(Is_file,Is_dir))... But you could go to over thousand of test like this. Anyway the test_file pattern is a direct copy of the command test in Unix, which is one of the most used in Unix, so i think it is enough powerfull ( i just have removed all the test concerning strings ). > val filter : (Unix.stats -> bool) -> string list -> string list (** we are > clearly showing the dependency to unix here *) > > Other things I would like to get added to the Filename module : > > val extension : string -> string (* returns the extension of the file or "" > if no extension *) > val switch_extension : file:string -> ext:string -> string (* change the > extension of a filename *) > I agree on this, just raising an exception if extension is not found ( raise Not_found ), better than returning "". Kind regard Sylvain LE GALL |