Reading and writing tar files.
This extension allows extracting files from tar archives and writing files into them.
Reads the next header-record from PORT (which defaults to the value of (current-input-port)) and returns two values: an input-port representing the contents of the next file in the archive and a tar-header record. If no more files are stored in the archive, then #!eof and #f is returned.
Writes the data given in STRING as FILENAME to the archive designated by the output port PORT (which defaults to the value of (current-output-port)).
The keyword arguments specify additional information in the header-record for this file, see the table below for the default used when no arguments are given:
mode | (bitwise-ior perm/irusr perm/iwusr perm/irgrp perm/gwgrp perm/iwoth perm/iwoth) | Permissions |
uid | (current-user-id) | Numeric user-id of the file owner |
gid | (current-group-id) | Numeric group-id of the file owners |
modification-time | (current-seconds) | Modification-time of the file when it was archived as the number of seconds from Jan.1, 1970 UTC |
type-flag | 'normal | One of symbols normal, oldnormal, link, symlink, chr, blk, dir, fifo, contig |
link-name | "" | Name of a hard or symbolic link |
uname | (car (user-information uid)) | Username of the file owner |
gname | (car (group-information gid)) | Groupname of the file owners |
devmajor | 0 | Major device number of device-files of type blk or chr |
devminor | 0 | Minor device number of device-files of type blk or chr |
After the last file, a termination record should be written to the port that represents the archive (invoke tar:write-to-archive with #f as the FILENAME argument).
Returns #t when X is a header-record or #f otherwise.
Accessors for various fields of a tar header record.
Copyright (c) 2006-2007, Felix Winkelmann. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ASIS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.