I am unable to delete a mp3 file from C++ using remove(), neither can rename it using rename() function. What can I do to troubleshoot this?
+1
A:
This file is most likely either open by another process (in which case you can find the process using it using ProcessExplorer, assuming you're on Windows), or the file/directory are read-only, or you don't have permissions to the file.
Solutions to either of these belong on either SuperUser for Unix or ServerFault for Windows, please re-post there with more details
DVK
2009-09-26 17:13:08
don't suggest using a priviledge user, this is overkill for a simple file deletion and worse can be a security problem
dharga
2009-09-26 17:19:27
He doesn't suggest using a privileged user, he is suggesting to post at the superuser.com or serverfault.com sites.
Aragorn
2009-09-26 17:29:40
SuperUser for Unix? ServerFault for Windows? No, no, no. This is a programming question.
Thomas Owens
2009-09-26 17:40:33
Why the down-vote?
DVK
2009-09-27 04:15:54
@Thomas: the reason OP can't delete is file is probably OS related. Looks like the best we could do to answer that is to explain OP how to print errors as the library calls probably returns an error when it fails.
kriss
2010-03-30 00:51:53
A:
This file is most likely either open by another process? how come this is possible..?? my vlc player is off.
Rahul
2009-09-26 17:39:04