27 Archives
(require denxi/archive) | package: denxi |
denxi/archive extracts files from a single archive file.
value
:
(parameter/c (-> path-string? (or/c #f (-> input-port? any))))
The default value always returns #f.
procedure
(extract in) → (subprogram/c 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 subprogram 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 current-find-extract-procedure.
procedure
(extract-input name #:keep? any/c) → subprogram?
name : string? any/c : #f
struct
(struct $extract-report (status target))
status : symbol? target : any/c
status is
'unsupported if there was no known way to extract the archive.
'done if the extraction finished successfully.