Re: [Haskell-cafe] ANNOUNCE: Glob 0.1, globbing library

On Fri, Oct 17, 2008 at 22:02, Matti Niemenmaa
Greetings to all,
I hereby announce the release of Glob 0.1, a small library for glob-matching purposes based on a subset of zsh's syntax.
Web page at: http://iki.fi/matti.niemenmaa/glob/index.html Hackage: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Glob
Simple example: match (compile "foo*baz") "foobarbaz" == True.
It can also group the contents of a directory given a list of patterns to match: globDir [compile "foo*baz"] "<a directory containing foobarbaz and joe>" gives (["dir/foobarbaz"],["dir/joe"]).
Comments, complaints, feature requests, bug reports are all welcome. It should work on both GHC 6.8 and 6.10, but I've only tested the latter.
Hello I tried out your package, but it doesn't seem to work correctly on Windows. I checked the code and it has directory separator hard coded, which seem to be the source of problems. Please see: http://www.haskell.org/ghc/docs/latest/html/libraries/filepath/System-FilePa... All best Christopher Skrzętnicki

Gah, I fail at posting to mailing lists. For posterity, the message I sent to Krzysztof: Krzysztof Skrzętnicki wrote:
On Fri, Oct 17, 2008 at 22:02, Matti Niemenmaa
wrote: Web page at: http://iki.fi/matti.niemenmaa/glob/index.html Hackage: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Glob
I tried out your package, but it doesn't seem to work correctly on Windows. I checked the code and it has directory separator hard coded, which seem to be the source of problems.
Interesting, given that I've only tested it on Windows. ;-) Can you give an example which doesn't work?
Please see:
http://www.haskell.org/ghc/docs/latest/html/libraries/filepath/System-FilePa... I tried to be diligent about using isPathSeparator and the related functions and constants (even isExtSeparator), and a grep over the code reveals nothing, so if something doesn't work I don't think it's because of that. P.S.: I just uploaded 0.2 which has a somewhat speedier globDir. No functionality changes.

On Sat, Oct 18, 2008 at 19:28, Matti Niemenmaa
Gah, I fail at posting to mailing lists. For posterity, the message I sent to Krzysztof:
Krzysztof Skrzętnicki wrote:
On Fri, Oct 17, 2008 at 22:02, Matti Niemenmaa
wrote: Web page at: http://iki.fi/matti.niemenmaa/glob/index.html Hackage: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Glob
I tried out your package, but it doesn't seem to work correctly on Windows. I checked the code and it has directory separator hard coded, which seem to be the source of problems.
Interesting, given that I've only tested it on Windows. ;-) Can you give an example which doesn't work?
Ouch... I feel like I deserve an entry on http://failblog.org/ Somehow I assumed that globDir has type [Pattern] -> FilePath -> IO [FilePath] where in reality it has type [Pattern] -> FilePath -> IO ([[FilePath]], [FilePath]) When I saw lots of files that didn't match my query I thought there is a bug... I'll certainly doublecheck any bug reports before submitting. Sorry for the noise. All best Christopher Skrzętnicki
participants (2)
-
Krzysztof Skrzętnicki
-
Matti Niemenmaa