LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   removing file (https://www.linuxquestions.org/questions/programming-9/removing-file-406125/)

sahel 01-21-2006 07:13 AM

removing file
 
when i use remove(filename) in c; it removes that file but replaces it with .nfs0209c0fb0000002e with the same contents of the last one

do you have any idea???

mic 01-21-2006 08:42 AM

remove() should simply remove the file and not just rename it. Try this:
Code:

#include <stdio.h>

...

if (remove("test") < 0) {
        perror("remove");
}

And see if you get any output.

xhi 01-21-2006 10:14 AM

the .nfsNN file is created when a file is accessed on the nfs and then when you delete the orgiginal file, the copy .nfsNN is left.. make sure the file is closed when you delete it.. if that does not do it, you may have to use a function specific to nfs.. remove() may not be able to do it..

kshkid 01-23-2006 12:29 AM

try decrementing the file count to 0,

by unlinking it,

unlink system call


All times are GMT -5. The time now is 02:34 PM.