So the file, and some number of parent directories, are going to
be deleted. Do you care to know about the deletion status of the
parents?
> /foo//bar//baz
This suggestion would also work.
> HOWEVER, in the end I decided that this doesn't make any difference. The
> "(deleted)" at the end is more human-readable, and as the name is really
> only for readability anyway. If you want to do machine-readability, it's a
> lot easier to do a "stat()" on the file and look at the i_nlink value
> (zero means it's deleted).
Mightn't there be other hard links to the file? The name it was opened
by (say, /usr/bin/ex) might have been deleted, but /usr/bin/vi and
/usr/bin/view might still work.
(H'm... as soon as I reboot, I'll have to try "ln /proc/self/fd/0 /tmp/foo < /tmp/bar", and the equivalent with a deleted file.)
-- -Colin