View topic - remove () failed

remove () failed

anything that doesn't fit to other groups.

remove () failed

Postby rashidmirza » Tue Sep 13, 2011 1:08 pm

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?
rashidmirza
Active Member
 
Posts: 55
Joined: Sun Jun 13, 2010 4:32 am

Re: remove () failed

Postby rashidmirza » Fri Sep 16, 2011 8:41 am

just want to add also , that the directory object i.e dirObj = readdir(someDirectory) is null after a failed remove().
rashidmirza
Active Member
 
Posts: 55
Joined: Sun Jun 13, 2010 4:32 am

Re: remove () failed

Postby maschoen » Sat Sep 17, 2011 8:00 am

How about this. If your file system is corrupted, all bets are off. At startup run chkfsys. While you are up and running, you should not get any corruption in the file system unless you are having hardware problems with memory or the hard drive. If you are having hardware problems, all bets are off.
maschoen
QNX Master
 
Posts: 2715
Joined: Wed Jun 25, 2003 5:18 pm


Return to General Programming

Who is online

Users browsing this forum: No registered users and 2 guests