Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/caolan/chicken-fnmatch
Test filenames against shell wildcard patterns using fnmatch
https://github.com/caolan/chicken-fnmatch
Last synced: 11 days ago
JSON representation
Test filenames against shell wildcard patterns using fnmatch
- Host: GitHub
- URL: https://github.com/caolan/chicken-fnmatch
- Owner: caolan
- Created: 2014-07-27T10:39:10.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-07-30T13:57:03.000Z (over 10 years ago)
- Last Synced: 2024-10-11T07:35:11.415Z (about 1 month ago)
- Language: Scheme
- Size: 133 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# chicken-fnmatch
CHICKEN Scheme bindings for fnmatch(3). Provides glob-like pattern matching for
filenames using shell wildcard patterns.## Example use
```scheme
(fnmatch "dir/*.scm" "dir/foo.scm") ;; => #t
(fnmatch "dir/*.scm" "dir/foo.txt") ;; => #f
```## API
### fnmatch
```scheme
(fnmatch path pattern #!key (escape #t) (pathname #t) (period #f))
```Tests a pathname against a pattern, returning #t for a match or #f for
no match.#### Keyword arguments:
- __escape:__ when set to #f, treat backslash as an ordinary character, instead
of an escape character
- __pathname:__ match a slash in string only with a slash in pattern and not by
an asterisk (*) or a question mark (?) metacharacter, nor by a
bracket expression ([]) containing a slash
- __period:__ a leading period in string has to be matched exactly by a period
in pattern. A period is considered to be leading if it is the
first character in string, or if both 'pathname' is set to #t
and the period immediately follows a slash