long TS_seek_file(int hdl,int type,long loc)

{

union LONG_III aa;

regs.h.ah=0x42; regs.h.al=(unsigned char)type; regs.x.bx=hdl;

aa.l.ll = loc; regs.x.cx=aa.i.ii2; regs.x.dx=aa.i.ii1; int86(0x21,®s,®s); aa.i.ii2=regs.x.dx; aa.i.ii1=regs.x.ax;

if ((regs.x.cflag & 0x01) == 0) return(aa.l.ll); else return(-1L);

 

}

 

43

Get file attribute

 

 

Entry Parameters:

AH = 43

 

 

AL = 0

 

 

DS:DX = segment:offset of ASCIIZ file name

 

Returned Values:

if file found: Carry = Clear, CX = 0

 

 

if file not found: Carry = set, AX = 2

 

int TS_check_file_exit(char *str)

 

{

 

 

regs.h.ah=0x43;

 

 

regs.h.al=0;

 

 

segregs.ds = FP_SEG(str);

 

regs.x.dx = FP_OFF(str);

 

int86x(0x21,®s,®s,&segregs);

 

if ((regs.x.cflag & 0x01) == 0) return(1);

}

else return(0);

 

 

 

56

Rename a file

 

 

Entry Parameters:

AH = 56

 

 

DS:DX = pointer to ASCII filename to be renamed

 

 

ES:DI = pointer to new ASCII filename

 

Returned Values:

AH = 0 and clear Carry flag ;if success

1 and set Carry flag ;if not success

int TS_rename_file(char *inf,char far *outf)

{

3-55

Page 56
Image 56
Unitech MR350MKII manual Get file attribute, Rename a file