unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Thien-Thi Nguyen <ttn@gnuvola.org>
To: guile-devel@gnu.org
Subject: Re: port-filename and path canonicalization
Date: Thu, 22 Apr 2010 09:42:57 +0200	[thread overview]
Message-ID: <87tyr40w72.fsf@ambire.localdomain> (raw)
In-Reply-To: <87tyr4tpb0.fsf@gnu.org> ("Ludovic Courtès"'s message of "Thu, 22 Apr 2010 00:26:43 +0200")

() ludo@gnu.org (Ludovic Courtès)
() Thu, 22 Apr 2010 00:26:43 +0200

   > That is, if a file port supports ‘file-port-directory’, then how
   > to use/restrict the resulting object is left up to higher layers,
   > where it belongs.

   I would put it the other way round: if an application wants to
   implement ‘file-port-directory’, then it’s its responsibility
   to associate the necessary information (and authority) with
   open file ports (those under its control, that is.)

   It’s an application of the principle of least authority.

Sure, given the model that access and authority are equivalent.
My point is that it is possible to use a model where they aren't.
A system that supports the latter model can build the former on top.
But a system that supports only the former model can only fake the
latter model, later.

It's always easier to combine separate things later than to
separate conflated things later.  The canonicalization wranglings
highlight this.

Canonicalization is a high-level concept needed because the
low-level access was not granular enough.  A filename with
directory components of an already validated (opened, accessed,
processed in the Right Way) file implies that all the parent
directories have also *already* been validated (in their own way).
But that, and related, information is lost, so we need to
canonicalize in order to re-validate those portions.

If that directory information is saved (simple internal caching),
these particular recomputations are avoidable.

If that directory information is available to the application
(reified and appropriately sanitized), the application can layer
authority measures as it sees fit (as you state in the first
paragraph, IIUC), in addition to enjoying the efficiency gain,
and the need for canonicalization disappears.

(Actually, the need for canonicalization disappears even with
simple internal caching, but since the context of this discussion
is process B finding neighbors to a file created by process A,
it is no longer an internal matter.  Or perhaps that's just me
jumping ahead (i've got bugs, debuggers and debugging file formats
on the mind lately)?)

OK, back to the grindstone.  I'm digging my way out RCS duties
(one might view this as preparation for History Objects ;-) right
now, but hopefully will be able to transform word spew to code
spew (for Guile) in the next several weeks.

A last parting word/pointer on this thread re "path":
 (info "(standards) GNU Manuals")

thi




  reply	other threads:[~2010-04-22  7:42 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-19 14:52 file names embedded in .go Andy Wingo
2010-04-19 21:46 ` Thien-Thi Nguyen
2010-04-20  0:08   ` Jose A. Ortega Ruiz
2010-04-20 11:35     ` Thien-Thi Nguyen
2010-04-20 19:15       ` Jose A. Ortega Ruiz
2010-04-21  7:45         ` Thien-Thi Nguyen
2010-04-20  9:45   ` Andy Wingo
2010-04-20 10:34     ` Thien-Thi Nguyen
2010-04-19 23:12 ` port-filename and path canonicalization Ludovic Courtès
2010-04-20  9:42   ` Andy Wingo
2010-04-20 11:15     ` Thien-Thi Nguyen
2010-04-21  8:49       ` Ludovic Courtès
2010-04-21 19:16         ` Thien-Thi Nguyen
2010-04-21 22:26           ` Ludovic Courtès
2010-04-22  7:42             ` Thien-Thi Nguyen [this message]
2010-04-20 16:57     ` Ludovic Courtès
2010-04-22 11:10       ` Andy Wingo
2010-04-22 12:50         ` Ludovic Courtès
2010-04-19 23:23 ` file names embedded in .go Ludovic Courtès

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

  List information: https://www.gnu.org/software/guile/

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

  git send-email \
    --in-reply-to=87tyr40w72.fsf@ambire.localdomain \
    --to=ttn@gnuvola.org \
    --cc=guile-devel@gnu.org \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).