file deletion prob with c

June 18, 2009 at 00:04:39
Specs: Windows XP
plz give me a code to "delete any file input"
using c language...prasanjit

See More: file deletion prob with c

Report •


#1
June 19, 2009 at 15:41:35
papaii
The function you need is
int unlink(char* pathname)
where pathname is the file you want to delete. You can use an absolute pathname, or a pathname relative to the current working directory of your program.

On unix/linux you will need to include <unistd.h>
On windows, the function starts with an underscore: _unlink and you will need to include <io.h> and <stdio.h>

Windows may have other functions as well. What platform are you developing on?


Report •
Related Solutions


Ask Question