* Copyright (c) 1990 The Regents of the University of California.
* This code is derived from software contributed to Berkeley by
* Hugh Smith at The University of Guelph.
* %sccs.include.redist.c%
static char sccsid
[] = "@(#)delete.c 5.2 (Berkeley) %G%";
extern CHDR chdr
; /* converted header */
extern char *archive
; /* archive name */
extern char *tname
; /* temporary file "name" */
* Deletes named members from the archive.
afd
= open_archive(O_RDWR
);
SETCF(afd
, archive
, tfd
, tname
, RPAD
|WPAD
);
while (get_header(afd
)) {
if (*argv
&& files(argv
)) {
(void)printf("d - %s\n", chdr
.name
);
SKIP(afd
, chdr
.size
, archive
);
put_header(&cf
, (struct stat
*)NULL
);
copyfile(&cf
, chdr
.size
);
size
= lseek(tfd
, (off_t
)0, SEEK_CUR
);
(void)lseek(tfd
, (off_t
)0, SEEK_SET
);
(void)lseek(afd
, (off_t
)SARMAG
, SEEK_SET
);
SETCF(tfd
, tname
, afd
, archive
, RPAD
|WPAD
);
(void)ftruncate(afd
, size
+ SARMAG
);