Tuesday, July 28, 2009

I want to know how i can delete a file in C++(BORLAND C++\3)?

realy i can make files with (fopen) but i dont know how remove this file from its detination .

I want to know how i can delete a file in C++(BORLAND C++\3)?
See if the following function does what you are after...





int remove(const char *path);





- path being the file/path of the file you want to delete.
Reply:"Destination". As far as I know there is no such thing to delete a file. You can only overwrite.
Reply:On Linux and Unix systems you would need to use the system call "unlink". (Refer man page for details). If you are using Windows check MSDN to find out which system call deletes a file.





These cannot be done from the APIs in stdio.h. These are only for manipulating files for opening, reading and writing only.


No comments:

Post a Comment