From: Nicolas C. <war...@fr...> - 2004-02-01 09:49:40
|
> Sometimes ago we were discussing about a possible library manipulation > filename and files. > > I have almost created it. I think it is pretty stable but i need > extended testing on different filename, and an expert eye on my code. > > You can find documentation and tarball here : > http://www.gallu.homelinux.org/~gildor/ocaml-fileutils/ Hello, I had a look at SysPath. My first thoughs were that it's too much complex. It seems that in order to have multi OS library, you used several language features such as Functors , as well as a lexer plus a yacc parser for each system in order to parsing the paths. IMHO it's too heavyweight and the small differences ( drive letter and / against \ ) in path representation between systems should be handled with a maximal transparency. Using functors to abstract something is nice if you're expecting the future users of your library to have the will to extend it further. I don't think it applies to this problem, since we already know well the 3-4 differents systems ( Unix , MacOS, Windows, Cygwin-? ) and there is an almost-zero probability that another system using a different path representation will be added to this list in the future... Using a lexer and a yacc parser for parsing such easy things as paths is also - still IMHO - using a hammer to kick a mosquito. A simple custom lexer/parser such as the one I proposed in my original post should be enough and perhaps provide even better speed. In order to be KISS-compliant, I advise you to rewrote the whole SysPath using only one file and module. SysUtil looks very good, I have no complaints about it :) Regards, Nicolas Cannasse |