directory-tree module released

9/05/2009

I’ve released my first package, up now on hackage (haddock docs should be generated soon). The module provides a simple data structure that mirrors a directory tree, and some useful functions for doing IO on directories of files. You can read more about it here.

It’s very likely there are some bugs, especially related to cross platform issues with file names and paths. The module is also fairly bare, so please send me any requests for functionality that I haven’t thought of, as well as any bugs you might find.

You can install it with:

$ cabal install directory-tree

And get the source with:

$ darcs get http://coder.bsimmons.name/code/DirectoryTree/

I hope this is useful to someone!

There are 7 comments in this article:

  1. 9/05/2009a DirectoryTree module and some examples - LAMBDAPHONE says:

    [...] UPDATE: I’ve just released this as my first package on hackage. You can read more and write any comments here. [...]

  2. 18/09/2009Joe Edmonds says:

    Works great for my simple directory-reading task in ubuntu. It is the perfect abstraction for folding a bunch of email messages in a Maildir. 1 LOC and no System.IO boilerplate!

  3. 18/09/2009jberryman says:

    Joe, I’m glad! Let me know if you have any ideas for improving it.

  4. 6/11/2009Pepe Iborra says:

    Hi,

    I wanted to use directory-tree, but it chokes on a medium sized directory in my system (22 subdirectories, 350 files)

    *** Exception: getCurrentDirectory: resource exhausted (Too many open files)

    I am on Mac OS 10.6.1

  5. 6/11/2009Pepe Iborra says:

    Hi,

    I learnt that there is readDirectoryWith, which I can use to *not* readFile those files, which is what I am assuming readDirectory does. Neat.

    Quoting Conor McBride, I apologize for using your blog as a brain dump. I seem to have some sort of gold fish instead.

  6. 6/11/2009Pepe Iborra says:

    Can I suggest that you include a pretty printer for DirTree which gives the output that tree command-line utility does?
    That would be independently useful, and serve as a nice example.

  7. 8/11/2009jberryman says:

    Pepe: thanks for commenting and I hope the code is useful for you. I haven’t used it too much myself so I appreciate hearing about any bugs or weird behavior.

    I’ll see if I can whip up a pretty-printer or maybe steal one from another library. Thanks for the suggestion.

Write a comment: