#include #include #include #include "fio.h" #define DIRSIZE 14 g_char(a,alen,b) char *a,*b; ftnlen alen; { char *x=a+alen-1,*y=b+alen-1; *(y+1)=0; for(;x>=a && *x==' ';x--) *y--=0; for(;x>=a;*y--= *x--); } b_char(a,b,blen) char *a,*b; ftnlen blen; { int i; for(i=0;iy) for(;num>0;num--) *y++= *x++; else for(num--;num>=0;num--) *(y+num)= *(x+num); } else { register char *x=a,*y=b; if(x>y) for(;num>0;num--) *y++= *x++; else for(num--;num>=0;num--) *(y+num)= *(x+num); } } char *curdir() { char name[256],*bufpos = name; struct stat x; struct direct y; int file,i; *bufpos++ = 0; loop: stat(".",&x); if((file=open("..",0))<0) goto done; do { if(read(file,&y,sizeof(y))