Hi Anand,
Check out following things.
1. To delete a file you must check if file exists in first place. So before you fire delete() make sure that file exists
2. Once you make sure that file exists and if delete fails then it means that there is some handle open for the file. Please close all the handles for that particular file and then fire the delete command.
3. make sure that file in question is not being used by some other program. Even in this case delete() will return false.
Please perform above mentioned steps in order and I am sure that delete() will succedd 99.99% of the time.
HTH
