On this page:
in-paths
path-matching
$path-not-found
8.0

28 File System

 (require xiden/file) package: xiden

xiden/file extends and reprovides racket/file.

procedure

(in-paths pattern [start])  (sequence/c path?)

  pattern : (or/c regexp? pregexp? byte-regexp? byte-pregexp? string?)
  start : directory-exists? = (current-directory)
Returns a sequence of paths relative to start that match pattern.

If pattern is a string and not a regular expression object, then pattern is used as a glob pattern for use in glob-match?.

procedure

(path-matching pattern [start])  (logged/c path?)

  pattern : (or/c regexp? pregexp? byte-regexp? byte-pregexp? string?)
  start : directory-exists? = (current-directory)
Like in-paths, except this returns a logged procedure that fails with $path-not-found on the program log if no paths are found. Otherwise, the procedure uses the first matching path.

struct

(struct $path-not-found $message (pattern wrt))

  pattern : (or/c regexp? pregexp? byte-regexp? byte-pregexp? string?)
  wrt : path-string?
A message reporting if (path-matching pattern wrt) found no path.