chickadee » snowtar

snowtar

This egg provides procedures for reading tar files. It is capable of reading and writing files in the ustar, gnu, and v7 tar formats.

This is a port of the Scheme Now! tar package.

Author

Marc Feeley

Ported to CHICKEN by felix winkelmann.

Requirements

The miscmacros egg is required.

Record type

Tar entries are represented by the tar-rec record type.

Accessors

See the documentation of the various tar formats for further details on these fields. Some formats may not support all fields; if a given field is not supported, its accessor will return #f.

tar-rec-name tar-recprocedure

Returns the full path of the entry.

tar-rec-mode tar-recprocedure

Returns the octal file mode of the entry.

tar-rec-uid tar-recprocedure

Returns the octal numeric user ID of the entry.

tar-rec-gid tar-recprocedure

Returns the octal numeric group ID of the entry.

tar-rec-mtime tar-recprocedure

Returns the (epoch) last modification time of the entry.

tar-rec-type tar-recprocedure

Returns the numeric type flag of the entry.

tar-rec-linkname tar-recprocedure

Returns the linked path of the entry.

tar-rec-uname tar-recprocedure

Returns the user name of the owner of the entry.

tar-rec-gname tar-recprocedure

Returns the group name of the owner of the entry.

tar-rec-devmajor tar-recprocedure

Returns the major device number of the entry.

tar-rec-devminor tar-recprocedure

Returns the minor device number of the entry.

tar-rec-atime tar-recprocedure

Returns the (epoch) last access time of the entry. (gnu format archives only.)

tar-rec-ctime tar-recprocedure

Returns the (epoch) creation time of the entry. (gnu format archives only.)

tar-rec-content tar-recprocedure

Returns the file data of the entry.

Constructor

make-tar-rec name mode uid gid mtime type linkname uname gname devmajor devminor atime ctime contentprocedure

Returns a new tar-rec. Fields may be omitted by passing #f for the corresponding argument. See the Accessor documentation above for the types of the arguments.

Procedures

Packing

tar-pack-genport records portprocedure

records must be a list of tar-rec objects. port must be an output port.

Writes a tar archive containing the records to port. Raises an exception (a tar condition object) if any of the records contain unsupported fields or invalid field contents. Currently, the data is in ustar format.

tar-pack-file records pathprocedure

records must be a list of tar-rec objects. path must be a string describing a valid path.

Writes a tar archive containing the records to the file named by path. Raises an exception (a tar condition object) if any of the records contain unsupported fields or invalid field contents. Currently, the data is in ustar format.

tar-pack-u8vector recordsprocedure

records must be a list of tar-rec objects.

Encodes the records as a tar archive and returns this data as a u8vector. Raises an exception (a tar condition object) if any of the records contain unsupported fields or invalid field contents. Currently, the data is in ustar format.

Unpacking

tar-unpack-genport portprocedure

Decodes tar data from port and returns it as a list of tar records. Raises an exception (a tar condition object) if decoding fails for some reason.

tar-unpack-file pathprocedure

Decodes tar data from the file named by path and returns it as a list of tar records. Raises an exception (a tar condition object) if decoding fails for some reason.

tar-unpack-u8vector u8vectorprocedure

Decodes tar data from u8vector and returns it as a list of tar records. Raises an exception (a tar condition object) if decoding fails for some reason.

Conditions

make-tar-condition messageprocedure

Returns a new tar condition object encapsulating the message argument (a string). This is a composite condition with the following structure:

  • Kind-key exn with prop-key message.
  • Kind-key snow with prop-keys type and data.
  • Kind-key tar-condition.

See the (chicken condition) module for more information on condition objects.

tar-condition? objprocedure

Returns true iff obj is a tar condition object.

tar-condition-msg conditionprocedure

Returns the message encapsulated by condition.

Repository

GitHub

License

LGPL 2.1 or later.

History

1.0.1.1
fixed missing dependency (thanks to Mario)
1.0.1
initial import

Contents »