Open c-cube opened 10 years ago
Why not; there is an interesting, non-trivial logic to avoid looping endlessly in case of cyclic symbolic links. I'm not sure whether we'd want to return a sequence of directories, as Python's function does, or rather a tree (which can easily be turned into a sequence afterwards) -- I'd go for the tree interface.
that's an interesting idea; it could even be a kind of lazy tree (similar to BatSeq) for early termination. I like it.
This looks similar to/could be built rather simply on top of the find
function in FileUtils. How much overlap do we want between these libraries? Should something be used from there?
Indeed, it even looks more powerful thanks to the test system! Maybe a batteries-friendly interface to FileUtils would be nice, then. Something like wrapping FileUtil.find
in an Enum?
Actually that's an interesting global design issue: should we make wrappers around other libraries (lwt for instance?) with optional modules, that keep batteries quite small and still integrate it nicely with the rest of the OCaml ecosystem? Opam's conditional compilation would help keeping this sane.
This may be getting off-topic for a github bug discussion - but what is the proper approach for wrapping an external library for Batteries-friendly use? There are a few which would be nice to have in a Batteries-friendly form (Calendar, FileUtils, Lwt).
@hcarty let's move it to the mailing list if you want. edit: done
I also need this sometimes. There is one in FileUtils however. Not sure we should have one in batteries too.
I'm not sure whether it exists already, but an equivalent of python's os.walk would be very interesting for scripting in OCaml. I could implement it maintainers think it's useful.