* Copyright (c) 1990, 1993, 1994
* The Regents of the University of California. All rights reserved.
* 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 8.3 (Berkeley) %G%";
* Deletes named members from the archive.
afd
= open_archive(O_RDWR
);
/* Read and write to an archive; pad on both. */
SETCF(afd
, archive
, tfd
, tname
, RPAD
|WPAD
);
if (*argv
&& (file
= files(argv
))) {
(void)printf("d - %s\n", file
);
put_arobj(&cf
, (struct stat
*)NULL
);
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
, NOPAD
);
(void)ftruncate(afd
, size
+ SARMAG
);