HP3000-L Archives

June 1995, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Craig Fairchild <[log in to unmask]>
Reply To:
Craig Fairchild <[log in to unmask]>
Date:
Thu, 1 Jun 1995 14:19:39 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (85 lines)
Richard Gambrell sumarized this issue very well:
 
>For those of you following the . file saga:
>
>You can creat a file named . by the command: echo something > .
>You can see it with a command: listfile ./. ,2 ;temp
>You cna print it with a command: print .
>You can purge it with a command: purge .,temp
>
>Nice and consistent in MPE.
>But, under the posix shell (after the file is created):
>You can see the file with the command: ls -al
>BUT the . file is the *only* file reported by ls! (Normally
>this should show all files).
>You cannot refer to the file in any way that I have found (any
>reference from sh seems to find the . meaning current directory, not
>the file .
 
Actually, I think I can shed some light on the POSIX shell "inconsistency."
The object named "." can only exist in the temporary or new file domains, since
a "." already exists (or at least we pretend it exists for MPE directories) in
every directory of the permanent domain.  Remember that MPE has always
supported three distinct file domains; new, in which files are only known to
the process that created them and are automatically released when the process
terminates, temporary, in which files can be seen by all processes within a
given job or session and are automatically released when the job or session
terminates, and permanent, which are viewable by all processes on the system
(and accessible subject to security rules) and are never automatically
released.
 
Now in the UNIX or POSIX world view, there is only a permanent file domain.
There is no concept of any other file domain, and no way to access it or even
see it (the >callci command doesn't count!).  Thus, the ls command that you
were issueing was never showing you the "." file that you had open in your
temporary directory - it couldn't since it doesn't know such a thing even
exists.  This also explains why none of the other shell commands could
reference this file.  Actually, the shell is consistent in its inability to
see the "."
 
I'm not sure why the ls -al that you did produced results that weren't
acceptable.  Perhaps there is a problem in the shell that you discovered.
 
Also, there's been some discussion in this thread about how a file and a
directory can exist with the same name in the temporary directory.  This is
due to the way that the temporary directory is implemented.  There are actually
*no* directories in the temporary or new file domains - beleive me, you
wouldn't want the disk space or the time spent to recreate the directory
structures in each of these domains.  The only directory structure on the
system is the directory structure defined by the permanent domain (this has
always been true - it's not just some "strangeness"
that POSIX brought in :-) ).  The temporary directory is actually a single
file that contains the fully qualified name of every file in the temporary
domain for a given job/session.  There is a unique temporary directory file
for each job/session that is shared by all processes within that job/session.
 
We actually go through a lot of effort to make it look like the temporary
files are grouped together by directory, but if you do a :LISTFILE /,6;TEMP
you'll see the files in pretty much the order that they appear in the
temporary directory itself.  Another interesting thing that you can do is to;
 
  :BUILD .;temp      { build our temporary file named "." }
  :LISTFILE /,-3;temp  { show detailed information about all files }
 
You'll notice that the root, account, and group files that are listed all
appear to be fixed length, ordinary files, all with the same label address as
the only "real" file, ".".  Compare the :LISTFILE ,-3 output of the temporary
domain against the same output against the real permanent directories.  You'll
see quite a different picture.
 
So, the reason that you can have "duplicate" names in the temporary directory
is that the directory file name isn't really in the temporary directory and
so you don't really have any duplication.  However, you could consider that a
bug in that the :LISTFILE command presents the information in a way that is
confusing.  Maybe we should have put in an extra restriction preventing this.
By the way, there already is a restriction against being able to create a
real directory file in anything but the permanent file domain. So not only do
the directory names not appear in the temporary directory, you can't even
create a directory file in the temporary directory.
 
Well, a "ramble meter" has gone off on my workstation, so I guess I better
get back to work.  I hope this was helpful to someone, and not just cathartic
to me!
 
Craig

ATOM RSS1 RSS2