Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

auto-creation of .nfs files

159 views
Skip to first unread message

apat...@aircom.com

unread,
Jan 13, 1999, 3:00:00 AM1/13/99
to apat...@aircom.com
Hi,

I am running Solaris 2.5 and have an application that
does file I/O, specifically it calls the following functions:
mkdirp
fopen
stat
creat
fclose
fflush
remove

I check return codes from all the functions above to
be sure they succeeded.

When other developers run my application, they see
some mysterious .nfsXXX files being auto-created in their
directories. And the strange thing is that these files cannot
be deleted. Instead it appears that they are automatically removed
the next day or so.

Does anyone know what causes .nfsxxx files to get auto-created?

We checked the sun solve site, but could not find anything
relevant.

Thanks for any clues!

Anjela Patnaik
apat...@aircom.com

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own

Andrew Gierth

unread,
Jan 13, 1999, 3:00:00 AM1/13/99
to
>>>>> "apatnaik" == apatnaik <apat...@aircom.com> writes:

apatnaik> When other developers run my application, they see some
apatnaik> mysterious .nfsXXX files being auto-created in their
apatnaik> directories. And the strange thing is that these files
apatnaik> cannot be deleted. Instead it appears that they are
apatnaik> automatically removed the next day or so.

apatnaik> Does anyone know what causes .nfsxxx files to get
apatnaik> auto-created?

They are created when a file on an NFS-mounted filesystem is open by a
process running on the local client, but has been unlinked while open.

On a local filesystem, such files become invisible, but on NFS the
delete command can't be propagated to the server without affecting
access to the file data (NFS doesn't keep track of whether files are
open on clients or not), so the file is renamed instead, and then
deleted as soon as it is no longer open on the client that tried to
delete it.

--
Andrew.

comp.unix.programmer FAQ: see <URL: http://www.erlenstar.demon.co.uk/unix/>
or <URL: http://www.whitefang.com/unix/>

Keith Michaels

unread,
Jan 14, 1999, 3:00:00 AM1/14/99
to apat...@aircom.com
In article <77ivt5$boa$1...@nnrp1.dejanews.com>,

apat...@aircom.com writes:
|> Hi,
|>
|> I am running Solaris 2.5 and have an application that
|> does file I/O, specifically it calls the following functions:
|> mkdirp
|> fopen
|> stat
|> creat
|> fclose
|> fflush
|> remove
|>
|> I check return codes from all the functions above to
|> be sure they succeeded.
|>
|> When other developers run my application, they see
|> some mysterious .nfsXXX files being auto-created in their
|> directories. And the strange thing is that these files cannot
|> be deleted. Instead it appears that they are automatically removed

|> the next day or so.
|>
|> Does anyone know what causes .nfsxxx files to get auto-created?
|>
|> We checked the sun solve site, but could not find anything
|> relevant.
|>
|> Thanks for any clues!
|>
|> Anjela Patnaik
|> apat...@aircom.com
|>
|> -----------== Posted via Deja News, The Discussion Network ==----------
|> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own

These are created by NFS in order to handle the situation when open
NFS files are deleted. They go away automatically because a cron job
deletes them after 7 days.

Look in:

/usr/lib/fs/nfs/nfsfind

Casper H.S. Dik - Network Security Engineer

unread,
Jan 14, 1999, 3:00:00 AM1/14/99
to
[[ PLEASE DON'T SEND ME EMAIL COPIES OF POSTINGS ]]

k...@sdc.cs.boeing.com (Keith Michaels) writes:


>These are created by NFS in order to handle the situation when open
>NFS files are deleted. They go away automatically because a cron job
>deletes them after 7 days.


If the client doesn't crash, the files will be removed automatically
once they're no longer open on the client.

Its' the client who creates and destroys .nfs* files.


Caspeasper
--
Expressed in this posting are my opinions. They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.

apat...@aircom.com

unread,
Jan 15, 1999, 3:00:00 AM1/15/99
to
Thanks for the responses. Now, is there any
way to write the file I/O code such that
.nfs files don't get auto-created?

I know they are deleted automatically, but
it's cleanest to not cause them to get auto-created
in the first place, if this is feasible.

We are using NFS so not having NFS is not an option.

Are there unix library calls on the client side that don't
cause files to get renamed, and simply forcefully remove them?

Thanks again,
apat...@aircom.com


In article <casper.9...@nl-usenet.sun.com>, Caspe...@Holland.Sun.Com

-----------== Posted via Deja News, The Discussion Network ==----------

0 new messages