On this page:
extract
extract-input
$extract-report
8.0

25 Archives

 (require xiden/archive) package: xiden

xiden/archive extracts files from a single archive file.

procedure

(extract in)  (logged/c (or/c FAILURE void?))

  in : (or/c path-string? input-port?)

extract offers no control over the destination paths of extracted files. Use in-paths or path-matching to select extracted items.

Returns a logged procedure P that extracts files from in with respect to (current-directory).

If in is a path-string?, then (extract in) is equivalent to (call-with-input-file in extract). The rest of this entry assumes in is an input port.

If P cannot figure out how to extract files, it will return FAILURE and log ($extract-report 'unsupported (object-name in)).

If P succeeds, it will return (void) and log ($extract-report 'done (object-name in)).

The extraction process infers the archive format from the file extension in (object-name in). If this is ".tar", then P behaves like untar. If ".tgz" or ".tar.gz", then untgz. If ".zip", unzip. Otherwise, P will attempt to use a plugin’s get-extract-procedure.

procedure

(extract-input name #:keep? any/c)  logged?

  name : string?
  any/c : #f
Like extract, except archive data is drawn from the input found using (input-ref name) and resolve-input. If keep? is #f, the input is released using release-input after extraction.

struct

(struct $extract-report (status target))

  status : symbol?
  target : any/c
Describes the behavior of a call to extract. target is eq? to the object-name of the input port used in the corresponding extract call.

status is