|
|
coherent
/* $Source: /var/lib/cvsd/repos/coherent/coherent/e/bin/pax/append.c,v $
*
* $Revision: 1.1.1.1 $
*
* append.c - append to a tape archive.
*
* DESCRIPTION
*
* Routines to allow appending of archives
*
* AUTHORS
*
* Mark H. Colburn, NAPS International ([email protected])
*
*
* Sponsored by The USENIX Association for public distribution.
*
* Copyright (c) 1989 Mark H. Colburn.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice is duplicated in all such
* forms and that any documentation, advertising materials, and other
* materials related to such distribution and use acknowledge that the
* software was developed * by Mark H. Colburn and sponsored by The
* USENIX Association.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* $Log: append.c,v $
* Revision 1.1.1.1 2019/05/29 04:56:41 root
* coherent
*
* Revision 1.1 92/08/28 08:01:54 bin
* Initial revision
*
* Revision 1.1 89/02/14 16:47:35 jep
* Initial revision
*
* Revision 1.1 88/12/23 18:02:00 mark
* Initial revision
*
*/
#ifndef lint
static char *ident = "$Id: append.c,v 1.1.1.1 2019/05/29 04:56:41 root Exp $";
static char *copyright = "Copyright (c) 1989 Mark H. Colburn.\nAll rights reserved.\n";
#endif /* ! lint */
/* Headers */
#include "pax.h"
/* append_archive - main loop for appending to a tar archive
*
* DESCRIPTION
*
* Append_archive reads an archive until the end of the archive is
* reached once the archive is reached, the buffers are reset and the
* create_archive function is called to handle the actual writing of
* the appended archive data. This is quite similar to the
* read_archive function, however, it does not do all the processing.
*/
#if __STDC__
void append_archive(void)
#else
void append_archive()
#endif
{
Stat sb;
char name[PATH_MAX + 1];
name[0] = '\0';
while (get_header(name, &sb) == 0) {
if (((ar_format == TAR)
? buf_skip(ROUNDUP((OFFSET) sb.sb_size, BLOCKSIZE))
: buf_skip((OFFSET) sb.sb_size)) < 0) {
warn(name, "File data is corrupt");
}
}
/* we have now gotten to the end of the archive... */
/* reset the buffer now that we have read the entire archive */
bufend = bufidx = bufstart;
lseek(archivefd, -((OFFSET) blocksize), 1); /* VLAD. duncing arround bugs */
create_archive();
}
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.