[Ecls-list] open :supersede and rename-file advise

Richard M Kreuter kreuter at progn.net
Thu Nov 29 22:18:02 UTC 2007


"Geo Carncross" writes:
> On Nov 29, 2007 1:47 PM, Richard M Kreuter <kreuter at progn.net> wrote:

> > I don't say that these mean your approach isn't good; only that it's
> > worthwhile to be mindful of the tradeoffs involved.
> 
> No, this is helpful. I'm not taking offense to any of this, and in
> fact I'm glad you're making me think about this more. There's
> obviously a lot of questions here which is why I started this by
> asking for advise instead of a quick patch :)

There's another class of details that occurred to me today.  When you
open a Unix file destructively, hard links, permissions, ownerships, and
maybe some other metadata are preserved.  When you create a fresh file,
you get new permissions, ownerships, etc.  So there are some decisions
to make:

* Do you try set metadata on the freshly created write-beside file to
  match the file you will eventually supersede?

* Do you try to match the metadata at the time when you create the
  write-beside file, or when you close it?  The target file's metadata
  may change in the interim (the target file might have already been
  unlinked!).

* What do you do in case of failures to set that metadata?  For example,
  I don't think an unprivileged process can change the owner of a file
  under Unix.

* How hard do you work to find non-standard but maybe-important metadata
  like access control lists?

Note that these questions apply to any case where you create a new file,
lazily or eagerly.

--
Richard




More information about the ecl-devel mailing list