glob-posix- Haskell bindings for POSIX glob library.

Copyright(c) Reuben D'Netto 2016
LicenseApache 2.0
Safe HaskellSafe



This module provides a wrapper around the glob(3) C function, which finds file paths matching a given pattern. All of the standard flags are supported, though GNU extensions are contained in the System.Directory.Glob.GNU module to encourage portability.



(<>) :: Monoid m => m -> m -> m infixr 6 #

An infix synonym for mappend.


glob Source #


:: GlobFlag

The control flags to apply.

-> String

The pattern.

-> IO [FilePath]

The paths matching the pattern.

Finds pathnames matching a pattern. e.g foo*, prog_v?, ba[zr], etc.

globDefaults :: GlobFlag Source #

Default value - equivalent to 0 for the C function.

globMany Source #


:: GlobFlag

The control flags to apply.

-> [String]

A list of patterns to apply.

-> IO [FilePath]

The paths matching the patterns.

Like glob, but matches against multiple patterns. This function only allocates and marshals data once, making it more efficient than multiple glob calls.

data GlobFlag Source #

Control flags for glob. Use globDefaults if you have no special requirements. To combine multiple flags, use the <> operator (re-exported here for convenience). See man glob(3) for more information.

globMark :: GlobFlag Source #

Append a / to each entry that is the path of a directory.

globNoCheck :: GlobFlag Source #

If there are no matches, return the original pattern.

globNoEscape :: GlobFlag Source #

Disable the use of @@ for escaping metacharacters.

globNoSort :: GlobFlag Source #

Do not sort the entries before returning them.