i have a piece of code, where certain directories and files are deleted, once they are deemed to be aged (certain criteria applicable).
This works fine, until the software encounters files that have funny characters in them, and this is caused if there is corruption on the system. Ideally there should not be any corruption.
Is there any way to make the software more intelligent, when it comes to deleting files that have funny names?
deletion of file is being done using the remove() function.
I think the program encounters a problem when it tries to :
pDir = readdir(pDirH)
AFTER a failed remove(),
on the contrary, if the remove is successful, then readdir is fine…
I want to keep program flow working, rather than trying to delete corrupt files…any ideas…any checks i can introduce, after the remove, or before the readdir?