filemanip-0.3.6.3: Expressive file and directory manipulation for Haskell.

Copyright | Bryan O'Sullivan
License | BSD3
Maintainer | Bryan O'Sullivan <bos@serpentine.com>
Stability | unstable
Portability | everywhere
Safe Haskell | Safe-Inferred
Language | Haskell98

System.FilePath.GlobPattern

Contents

- Glob patterns
- Matching functions

Description

Synopsis

- type GlobPattern = String
- (~~) :: FilePath -> GlobPattern -> Bool
- (/~) :: FilePath -> GlobPattern -> Bool

# Glob patterns

Basic glob pattern syntax is the same as for the Unix shell environment.

- `*` matches everything up to a directory separator or end of string.
- `[range]` matches any character in range.
- `[!range]` matches any character not in range.

There are three extensions to the traditional glob syntax, taken from modern Unix shells.

- `\` escapes a character that might otherwise have special meaning. For a literal `"\"` character, use `"\\"`.
- `**` matches everything, including a directory separator.
- `(s1|s2|...)` matches any of the strings s1, s2, etc.

type GlobPattern = String #

Glob pattern type.

# Matching functions

(~~) :: FilePath -> GlobPattern -> Bool #

Match a file name against a glob pattern.

(/~) :: FilePath -> GlobPattern -> Bool #

Match a file name against a glob pattern, but return `True` if the match fails.