Zero bye file not deleting

Hi All...

The code i have written is 

if(filename)
remove_files (filename);

and my remove function is

void remove_files(char *rf)
{
if (remove(rf)==0)
printf("(%d) Deleting %s\n",getpid(), rf); // JC 10/24/2003
else
printf("(%d) Cannot delete %s\n",getpid(), rf);// JC 10/24/2003
}

The problem is if the file to be removed is a zero byte file it is not deleting . Please let me know how can i delete the zero byte file and let me know why remove is not removing zero byte file and how can i remove it ..

Thanks in advance,
Arun Kumar

Do you know the filename that the error is being thrown for? If you do, just run the command:

fuser -fu "full_path_to_filename"

This will show you the pid for any process has that file open. If you do get the pid, check for that using the 'ps' command and find if you can terminate that process. The file should get deleted after you kill the process.

Thanks working