On this page:
in-paths
path-matching
directory-empty?
something-exists?
linked?
file-link-exists?
$path-not-found
8.12

30 Files🔗ℹ

 (require denxi/file) package: denxi

denxi/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])  (subprogram/c path?)

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

procedure

(directory-empty? path)  boolean?

  path : path-string?
Returns (null? (directory-list path)).

procedure

(something-exists? path)  boolean?

  path : path-string?
(or (file-exists? path)
    (directory-exists? path)
    (link-exists? path))

procedure

(linked? link-path path)  boolean?

  link-path : path-string?
  path : path-string?
Returns #t if link-path refers to an existing link, a file, directory, or link exists at path, and both paths resolve to the same filesystem identifier.

procedure

(file-link-exists? link-path)  boolean?

  link-path : path-string?
Returns #t if link-path refers to an existing link, and the link points to a regular file.

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.