LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 01-21-2006, 08:13 AM   #1
sahel
LQ Newbie
 
Registered: Dec 2005
Posts: 21

Rep: Reputation: 15
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???

Last edited by sahel; 01-21-2006 at 08:31 AM.
 
Old 01-21-2006, 09:42 AM   #2
mic
Member
 
Registered: Jun 2005
Posts: 44

Rep: Reputation: 16
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.
 
Old 01-21-2006, 11:14 AM   #3
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
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..
 
Old 01-23-2006, 01:29 AM   #4
kshkid
Member
 
Registered: Dec 2005
Distribution: RHEL3, FC3
Posts: 383

Rep: Reputation: 30
try decrementing the file count to 0,

by unlinking it,

unlink system call
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
removing file sahel Programming 1 01-21-2006 07:15 AM
problem removing file easykillsoft Linux - General 1 11-19-2005 08:52 PM
removing the file junaid18183 Linux - Newbie 2 04-05-2005 10:55 PM
problem with removing file paulr1984 Linux - General 3 05-15-2004 03:28 PM
removing a file (--exclude is the name of the file) Santinelli Linux - General 2 01-14-2004 10:03 AM


All times are GMT -5. The time now is 12:37 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration