#include "dos.h"

#include "iostream.h"

main()

{

//AIM : to delete the file using intdosx()

      union REGS i,o;

      struct SREGS s;

      char fname[12];

      cout<<"\nEnter the file to be deleted : ";

      cin>>fname;

      i.h.ah=0x41; // request deletion service

      s.ds=FP_SEG(fname); //load segment part of the file to be deleted

      i.x.dx=FP_OFF(fname); //load offset part of the file to be deleted

      intdosx(&i,&o,&s);

      if (o.x.cflag==0)

            cout<<"\nfile "<<fname<<" deleted peacefully\n";

      else

            cout<<"\nfile "<<fname<<" could not be deleted\n";

      return 0;

}