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

:IF-EXISTS :SUPERSEDE vs. :NEWEST



We are having a little dispute here about the intended semantics of
:IF-EXISTS :SUPERSEDE on output, when the file version of the pathname
to be opened is :NEWEST.  The manual is not specific on what this means.

It seems as though it says, "Well, if there are any versions, find out
what the latest version is, and make believe you were attempting to
create that version with :IF-EXISTS :SUPERSEDE."  I contend that this
combination of arguments with :newest is sheer combinatorial fallout
from the spec, and is not only not useful, but this interpretation is
negatively useful.

First of all, :SUPERSEDE is intended for creating specific versions
and non-versionated file systems.  On non-versionated file systems,
it is usually the only file regeneration option you get.  If you
say :SUPERSEDE, you want to create a.b.3 no matter what.  If you
say :SUPERSEDE with a.b.newest, you want to create a.b.newest, which
is done by creating a new version, no matter what.   

Argument #1:
  Imagine a program that took user input for a file name, and wrote
  out to that file.  (Can't argue with that, right?).  Suppose further
  that this program did not like the CL default of :error, and wanted
  you to be able to write out to a.b.3 if that's what you said.
  So it might open its file with :IF-EXISTS :SUPERSEDE.  Well, suppose
  you said a.b.newest to it?  You CERTAINLY don't want it looking up
  what the latest version is and superseding it!  You want it to create
  a new version.

Argument #2:
  Given the primitives available to the file server in versionated
  operating systems, it is impossible to implement this as proposed
  without a window between determining the version number and opening
  it for superseding.

Carl Hoffman says,
    "I have an application which periodically dumps some data to the file a.b.
    Each time it makes such a dump, the previous data is no longer interesting to
    me, so I dump the data to the same file repeatedly, rather than filling up the
    directory with unwanted versions.  But, sometimes, I want to save one of the
    dumps, so I create a new version of a.b, and the program will begin writing to
    that new version instead.  If there are no versions of a.b in the directory
    at all, then I want a new version to be created, of course.
    :IF-DOES-NOT-EXIST :CREATE is assumed."
He should write his data to a.b.1 and copy it when he wants to.

Has CMU implemented this combination?  With what interpretation?
Does anyone else have feelings about the rightness or wrongness
of either, or any other, interpretation?  How do :OVERWRITE/:TRUNCATE
shed any light on this, if any