Bob Supnik lurking? (simh PDP11 question)

From: Tom Jennings <tomj_at_wps.com>
Date: Sun Oct 3 21:21:39 2004

On Sun, 3 Oct 2004, Ron Hudson wrote:

> Ok, What do you mean... It seems to me your saying that if I rename the
> file and name a new one in it's place the running process (simh) will
> continue to access the old file..(perhaps by inode)

The directory entry ("foo.x") simply points to the inode that
is the file. So once a process has a file opened, it references
the file via the inode, so renaming the file has no effect.

THe only "danger" is if the process needs to re-open the file
(after closing it) and you've renamed it, but that's obvious,
huh.

(This is a secure way to handle temporary files: a process
opens a file then deletes (unlinks) it, as long as the file
is open, it (the inode) continues to exist; it will disappear
when all references to the inode disappear, eg. you close the
file. The advantage is, since the file doesn't have a name
(in the directory) no other process can open it.)
Received on Sun Oct 03 2004 - 21:21:39 BST

This archive was generated by hypermail 2.3.0 : Fri Oct 10 2014 - 23:37:20 BST