954,500 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Deleting a file

hello friends this code for delete a file,when i was execute it i got o/p successbut the file was not deleted from my HDD.

#include<dos.h>
#include<conio.h>
#include<stdio.h>

main()
{
clrscr();
union REGS i,o;
char far *fname[67];
puts("enter" );
gets("fname");
i.h.ah=0x41;
i.x.ax=(int)fname;
printf("%d",i.x.ax) ;
intdos(&i,&o);
if(o.x.cflag==0)
printf("success") ;
else
printf("attempt failed");
getch();
};
Jawahar prabhu
Newbie Poster
21 posts since Sep 2008
Reputation Points: 8
Solved Threads: 1
 

After 8 posts, the community expects you to know how to use code tags. Click here

devnar
Junior Poster
149 posts since Sep 2008
Reputation Points: 124
Solved Threads: 18
 
hello friends this code for delete a file,when i was execute it i got o/p successbut the file was not deleted from my HDD.


Perhaps you should start a new thread then

Erikmmp
Newbie Poster
11 posts since Dec 2008
Reputation Points: 10
Solved Threads: 0
 

In order to delete a file you can use the function remove("filename");
instead of writing the whole program.

ajay.krish123
Junior Poster in Training
90 posts since Nov 2008
Reputation Points: 6
Solved Threads: 9
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You