On Fri 29 Apr 2011 19:30, Noah Lavine <noah.b.lav...@gmail.com> writes:
>> Is anyone interested in implementing a path library? > > I might be able to work on it. Super! > However, I don't know much about how Windows paths work. Are there any > special considerations beyond the directory separator? Yep! Check that racket web page I linked to. You don't have to implement all of it, but it should be possible to implement, given the path abstraction. > Also, are there any characters that are valid in filenames on some > systems but invalid on other systems? Ah, I see you are under the delusion that paths are composed of characters :) This is not the case. To the OS, paths are NUL-terminated byte arrays, with some constraints about their composition, but which are not necessarily representable as strings. It is nice to offer the ability to convert to and from strings, when that is possible, but we must not assume that it is indeed possible. Basically I think the plan should be to add scm_from_locale_path, scm_from_raw_path, etc to filesys.[ch], and change any pathname-accepting procedure in Guile to accept path objects, producing them from strings when given strings, and pass the bytevector representation to the raw o/s procedures like `open' et al. Then for a lot of the utilities, we can add (ice-9 paths) or something, and implement most of the utility functions in Scheme. Andy -- http://wingolog.org/