static char sccsid
[] = "@(#)tp3.c 4.1 %G%";
register char *ptr0
, *ptr1
;
if (d
->d_namep
== 0) continue;
if (*ptr0
++ != *ptr1
++) goto cont
;
if (*ptr0
&& *ptr0
!= '/') goto cont
;
(*how
)(d
); /* delete, extract, or taboc */
if (count
== 0 && rnarg
> 2)
printf("%s not found\n", *parg
);
if(d
->d_namep
== 0 || (d
->d_mode
&OK
) == 0) continue;
if (d
->d_size
== 0) continue;
/* find a place on the tape for this file */
size
= (d
->d_size
+BSIZE
-1)/BSIZE
;
if ((last
= first
+ size
) >= tapsiz
) maperr();
for (b
= first
; b
< last
; ++b
)
if (map
[(b
>>3) & MAPMASK
] & (1<<(b
&7))) {
register struct dent
*d
, *id
;
do { /* find new dent with lowest tape address */
if(d
->d_namep
== 0 || (d
->d_mode
&OK
) == 0) continue;
if (d
->d_tapea
< index
) {
if ((d
= id
) == 0) return;
d
->d_mode
&= ~OK
; /* change from new to old */
if (d
->d_size
== 0) continue;
if ((f
= open(name
,0)) < 0) {
printf("Can't open %s\n", name
);
for (index
= d
->d_size
/BSIZE
; index
!= 0; --index
) {
if (read(f
,(char *)tapeb
,BSIZE
) != BSIZE
) phserr();
if (index
= d
->d_size
% BSIZE
) {
if (read(f
,(char *)tapeb
,index
) != index
) phserr();
if (read(f
,(char *)tapeb
,1) != 0) phserr();
{ printf("%s -- Phase error \n", name
); }
bitmap() /* place old files in the map */
for(m
=map
;m
<&map
[MAPSIZE
];) *m
++ = 0;
if(d
->d_namep
!= 0 && (d
->d_mode
&OK
) == 0
&& d
->d_size
!= 0) setmap(d
);
if (d
->d_size
% BSIZE
) c
++;
if ((c
+= block
) >= tapsiz
) maperr();
i
= (block
>>3) & MAPMASK
;
if (bit
& map
[i
]) maperr();
printf("Tape overflow\n");
for(count
=0,nentr
=0;count
<ndirent
;count
++)
if(dir
[count
].d_namep
!= 0) nentr
++;
++reg
; /* address of first non-directory tape block */
printf("Tape overflow\n");
if (map
[(reg
>>3) & MAPMASK
] & (1 << (reg
&7))) {
printf("%4d entries\n%4d used\n", nentr
, nused
);
printf("%4d free\n", nfree
);
printf("%4d last\n", lused
);
for (count
= 3; count
; --count
) {
printf("%s%4d%4d%5d%9D ",s
,dd
->d_uid
, dd
->d_gid
,dd
->d_tapea
,dd
->d_size
);
m
= localtime(&dd
->d_time
);
printf("%2d/%2d/%2d %2d:%2d ",m
[5],m
[4]+1,m
[3],m
[2],m
[1]);
if (d
->d_size
==0) return;
if (verify('x') < 0) return;
if ((id
= creat(name
,d
->d_mode
)) < 0)
printf("%s -- create error\n", name
);
if (write(id
, (char *)tapeb
, BSIZE
) != BSIZE
) goto ng
;
if (count
= d
->d_size
% BSIZE
) {
if (write(id
, (char *)tapeb
, count
) != count
) {
ng
: printf("%s -- write error\n", name
);
chown(name
,d
->d_uid
& 0377, d
->d_gid
&0377);