:7	if (Vlvl>=8) V9 "hex_fmt=%02X='%c'",B8(hex_fmt),Dsp(hex_fmt) D;
:6		FP Vout,"%s/Vinit: +++ Can't get ttyname of file %d.\n"
:6			,pname,f F;
:6		PF "%s/Vinit: +++ Can't get ttyname of file %d.\n"
:6			,pname,f F;
	if (p = Findenv("HEX_WORD")) {
:7		if (Vlvl>=8) V9 "hex_word=%d",hex_word D;
	}

	for (f=0; f<3; f++) {
:6		V8 "File %d check ...",f D;
		if (Fstat(f,&st) == 0) {
:6			V8 "File %d is open.",f D;
			if (fp = d_openfile(f)) {	/* Fetch the openfile descriptor */
				fp->flgs |= File_OPEN;	/* Note that it's open */
				if (isatty(f) && (p = ttyname(f))) {
					MakStrM(&fp->name,p,-1,m_ofnm);
					fp->flgs |= File_TERM;
:6				} else {
:6					V8 "File %d is not a tty.",f D;
					Switch(f) {
					case  0:MakStrM(&fp->name,"STDIN",5,m_ofnm); break;
					case  1:MakStrM(&fp->name,"STDOUT",6,m_ofnm); break;
					case  2:MakStrM(&fp->name,"STDERR",6,m_ofnm); break;
					default:MakStrM(&fp->name,m_unknown,-1,m_ofnm); break;
					}
:6					if (Vlvl>6)
				}
				if (!fp->name.v)	/* Ensure a printable name */
					MakStrM(&fp->name,m_unknown,-1,m_ofnm);
:6			} else {
:6				V8 "File %d not in openfile list.",f D;
			}
:6		} else {
:6			V8 "File %d is not open.",f D;
		}
	}
	if (r > ac) r = ac;
	return r;
}
dmpstr(sp,dp)
	Str* sp;
	CP   dp;
{
:5		V1 "Str %s=[%08X,%d,%d,%X]",dp,sp->v,sp->l,sp->m,sp->p D;
}
