Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: .nfsXXX files



> What is the point of .nfsXXX files?  My boss just noticed lots of them
> in his NFS-mounted home directory.

Nothing much to do with zsh, except...  If you unlink a file, UNIX and its
relatives will usually leave the file contents on the disk until all files
open to it have been closed --- zsh uses this for temporary workspace,
opening the file and immediately unlinking it before it has ever been used.

However, this isn't a practical proposition under NFS, which tries to
remember as little as possible about the underlying file, to guard against
problems connecting to the server.  So instead, if the file is still being
accessed, it moves the file to a name beginning .nfs.  Since it can't be
sure when it has to be removed, because (I'm at the limits of my knowledge,
but I think this is correct) all the information about file descriptors is
on the client --- all it knows is it has received a request to read from or
write to a certain file --- they just get left around for cron to tidy up.
Usually there's a job that deletes all such files more than a few days old.

Now, although zsh does use unlinked files, it should only use them as
temporary storage in temporary directories.  So unless you have redefined
$TMPPREFIX this is probably not a shell-specific issue; it will happen any
time you use an NFS-mounted directory in this way.

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxxx>
Cambridge Silicon Radio, Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070



Messages sorted by: Reverse Date, Date, Thread, Author