[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Questions about OPEN



    Date: 5 Oct 84 16:36:33 EDT
    From: Charles Hedrick <HEDRICK@RUTGERS.ARPA>
    ....At the moment rename-file implies a close in our implementation.  This may
    be a bug.  (Would someone from the gang of 5 like to comment?)

I don't think anything but the CLOSE function should close a stream.  So
it's a bug.

    By the way, a suggestion for doing truename on systems where you don't
    know the name until close:  If you have some way of making a file
    invisible (e.g. by setting file protection so that no one can see it),
    you could close it when it is initially opened, make it invisible, and
    then open it for append access.  This is roughly what Tops-20 does
    internally.  (Tops-20 has the same problem that this scheme would have:
    if the system crashes while you are creating a file, you have this
    partially-created file lying around which you may need to use unusual
    methods to get rid of.)

I think it would be better to define the language to make as few assumptions
about the operating system as possible, rather than requiring some implementors
to go through contortions to make their file systems look like the file systems
of other implementors.  Obviously this has to stop before you reach a point
where no one can write a portable program because the language says nothing
about the semantics of any file system operation!  In the particular case
of TRUENAME on an output stream that created a new file, I think it would be
wisest to say that this operation "is an error" until the stream has been
closed.  Any system that knows the name earlier than that can simply not
check for the "error", and can save the name in the stream at the time it
closes it, for later use by the TRUENAME function.