Deleting a file

Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Sep 2008
Posts: 11
Reputation: Jawahar prabhu is an unknown quantity at this point 
Solved Threads: 1
Jawahar prabhu Jawahar prabhu is offline Offline
Newbie Poster

Re: Timer Function?

 
0
  #1
Dec 13th, 2008
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.
  1. #include<dos.h>
  2. #include<conio.h>
  3. #include<stdio.h>
  4.  
  5. main()
  6. {
  7. clrscr();
  8. union REGS i,o;
  9. char far *fname[67];
  10. puts("enter" );
  11. gets("fname");
  12. i.h.ah=0x41;
  13. i.x.ax=(int)fname;
  14. printf("%d",i.x.ax) ;
  15. intdos(&i,&o);
  16. if(o.x.cflag==0)
  17. printf("success") ;
  18. else
  19. printf("attempt failed");
  20. getch();
  21. };
Last edited by Narue; Dec 13th, 2008 at 6:27 pm. Reason: added code tags
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 146
Reputation: devnar will become famous soon enough devnar will become famous soon enough 
Solved Threads: 16
devnar's Avatar
devnar devnar is offline Offline
Junior Poster

Re: delete a file

 
1
  #2
Dec 13th, 2008
After 8 posts, the community expects you to know how to use code tags. Click here
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 11
Reputation: Erikmmp is an unknown quantity at this point 
Solved Threads: 0
Erikmmp's Avatar
Erikmmp Erikmmp is offline Offline
Newbie Poster

Re: Timer Function?

 
0
  #3
Dec 13th, 2008
Originally Posted by Jawahar prabhu View Post
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
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 90
Reputation: ajay.krish123 is an unknown quantity at this point 
Solved Threads: 8
ajay.krish123 ajay.krish123 is offline Offline
Junior Poster in Training

Re: Deleting a file

 
0
  #4
Dec 24th, 2008
In order to delete a file you can use the function
remove("filename");
instead of writing the whole program.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC