D
da Vinci
Greetings,
Onwards with the school studying.
Working on a program and need to delete a file from a known location
on the hard drive but cannot get anything I do to work.
I have tried to use the remove function that is included with <cstdio>
but cannot get it to work properly. My reference book has the
following....
int remove(const char *fname);
and I have found information on the internet using the same above
along with an if statement. When it returns -1 it prints out "Not
deleted" and when it returns 0 if prints "deleted".
However, it never deletes the file.
I have tried to use the system("del c:\deleteme.txt"); command as
well. When I have tweaked the above command, it continues to say the
file doesnt exist even though the path it shows is EXACTLY where the
file is.
I hate asking for code, in fact I think there is something in the FAQ
saying not to ask for it.... but can someone set me straight here.
Either I cannot figure out how to use the remove() properly or
something is afu.
Thanks gents.
Onwards with the school studying.
Working on a program and need to delete a file from a known location
on the hard drive but cannot get anything I do to work.
I have tried to use the remove function that is included with <cstdio>
but cannot get it to work properly. My reference book has the
following....
int remove(const char *fname);
and I have found information on the internet using the same above
along with an if statement. When it returns -1 it prints out "Not
deleted" and when it returns 0 if prints "deleted".
However, it never deletes the file.
I have tried to use the system("del c:\deleteme.txt"); command as
well. When I have tweaked the above command, it continues to say the
file doesnt exist even though the path it shows is EXACTLY where the
file is.
I hate asking for code, in fact I think there is something in the FAQ
saying not to ask for it.... but can someone set me straight here.
Either I cannot figure out how to use the remove() properly or
something is afu.
Thanks gents.