9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Douglas A. Gwyn" <DAGwyn@null.net>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] what a mess the Unix world has become
Date: Mon, 10 Feb 2003 10:04:16 +0000	[thread overview]
Message-ID: <3E46ACD7.50802@null.net> (raw)
In-Reply-To: <200302091005.h19A5d2A018648@localhost.localdomain>

Aharon Robbins wrote:
>>I think that one really should be able to do "test -r foo && cat foo"
>>without cat failing because of permissions.

Yes, that was the intention.  But the question comes into
even sharper focus if you try to test for writability.
What OS facility is there for determining whether a file
would be writable without actually modifying the file?
The answer: access(2).  Not a mere examination of the
mode bits; not a trial write to the file.  When something
like NFS is bolted onto Unix, access(2) is one of the
things that needs to be made to work right; if NFS has
complicated access rules then that is what access() needs
to tap into.  (Better in the filesystem support than in
user-mode utilities.)
VAX/VMS had a "probe" call that, as I recall, checked
whether an operation would succeed but didn't do the
operation.
Of course, all such facilities are somewhat limited in
that the condition of the file might change between a
probe and actually doing the operation.  There are
transaction-oriented filesystems (MUMPS comes to mind)
that cluster requests until a "commit" and implement a
well-defined rollback scheme when the commit is
unsuccessful.


  parent reply	other threads:[~2003-02-10 10:04 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-09 10:05 Aharon Robbins
2003-02-09 19:48 ` Mike Haertel
2003-02-10  9:00 ` [9fans] mpg123 Conor Williams
2003-02-10 12:02   ` Russ Cox
2003-02-10 14:14   ` Nigel Roles
2003-02-10 14:34     ` Fco.J.Ballesteros
2003-02-10 14:53       ` Axel Belinfante
2003-02-10 15:05         ` Fco.J.Ballesteros
2003-02-10 15:53       ` Conor Williams
2003-02-10 16:41         ` Fco.J.Ballesteros
2003-02-11 10:19     ` Conor Williams
2003-02-11 11:26       ` nigel
2003-02-13  9:02         ` Conor Williams
2003-02-10 18:13   ` Tad Hunt
2003-02-10 10:04 ` Douglas A. Gwyn [this message]
2003-02-10 11:58   ` [9fans] what a mess the Unix world has become Russ Cox
2003-02-10 15:20   ` Ronald G. Minnich
2003-02-11  9:29     ` Douglas A. Gwyn
2003-02-11 10:25       ` Geoff Collyer
2003-02-10 16:19 C H Forsyth
2003-02-10 20:26 ` Ronald G. Minnich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3E46ACD7.50802@null.net \
    --to=dagwyn@null.net \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).