Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: David Brown <caml-list@davidb.org>
To: skaller <skaller@users.sourceforge.net>
Cc: Damien Doligez <damien.doligez@inria.fr>, caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] unix.chop_extension
Date: Sat, 29 May 2004 09:02:26 -0700	[thread overview]
Message-ID: <20040529160226.GA10368@davidb.org> (raw)
In-Reply-To: <1085824870.3036.249.camel@pelican.wigram>

On Sat, May 29, 2004 at 08:01:10PM +1000, skaller wrote:

> It also isn't entirely clear how you would actually
> *measure* 'same result' in all cases -- normally
> this is obvious, but there will be nasty cases:
> the problem is that it is the nasty cases that
> are at issue here. opening x and ./x isn't
> the same thing on Unix due to permissions distinctions?

What nasty case are you thinking of?  Opening both "x" and "./x" will
require search (x) permission on the current directory, and will either
both work, or both fail in the same situations.

However, that is about the only "equivalent" path that is really
equivalent.  "foo/../x" and "x" may not be equivalent from a permission
perspective (or not at all, say if 'foo' is a symlink).

A good description might be: there are many paths that can possibly
refer to the same file.  A string manipulation library routine can
certainly come up with pathnames that are potentially equivalent.  To
determine real equivalence, something like 'realpath' should be used.
Of course, according to the Linux manpage for realpath:

  "Never use this function.  It is broken by design since it is
  impossible to determine a suitable size for the output buffer."

It wouldn't be very hard to implement realpath in ocaml, just using the
Unix module.  It could even be done safely :-)

Dave

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  reply	other threads:[~2004-05-29 16:03 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-24 20:04 skaller
2004-05-24 22:01 ` skaller
2004-05-25  8:46 ` Alex Baretta
2004-05-25  9:35   ` skaller
2004-05-25  9:46     ` Alain Frisch
2004-05-25 10:47       ` skaller
2004-05-25 11:51         ` sejourne kevin
2004-05-26 11:18           ` Florian Hars
2004-05-25 14:06         ` [Caml-list] Re: AAP (was: unix.chop_extension) Christophe TROESTLER
2004-05-25 13:37     ` [Caml-list] unix.chop_extension John Goerzen
2004-05-25 19:17     ` Richard Jones
2004-05-27  8:15   ` YANG Shouxun
2004-05-27  9:47     ` skaller
2004-05-26  9:05 ` Xavier Leroy
2004-05-26  9:35   ` Luca Pascali
2004-05-26  9:56   ` Remi Vanicat
2004-05-26 10:34   ` skaller
2004-05-26 13:27     ` Damien Doligez
2004-05-26 15:50       ` skaller
2004-05-26 16:04         ` Damien Doligez
2004-05-27  4:33           ` skaller
2004-05-27  4:56             ` John Goerzen
2004-05-28 16:44             ` Damien Doligez
2004-05-28 19:34               ` skaller
2004-05-29  8:37                 ` Damien Doligez
2004-05-29 10:01                   ` skaller
2004-05-29 16:02                     ` David Brown [this message]
2004-05-26 11:21   ` Alex Baretta
2004-05-26 16:43     ` Richard Jones
2004-05-27  4:48       ` skaller
2004-05-27  7:46         ` Markus Mottl
2004-05-27  9:33           ` skaller
2004-05-27 17:29       ` brogoff
2004-05-28 12:00         ` Keith Wansbrough
2004-05-28 16:43           ` brogoff
2004-05-28 17:49             ` Marcin 'Qrczak' Kowalczyk
2004-05-28 11:23       ` Alex Baretta

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=20040529160226.GA10368@davidb.org \
    --to=caml-list@davidb.org \
    --cc=caml-list@inria.fr \
    --cc=damien.doligez@inria.fr \
    --cc=skaller@users.sourceforge.net \
    /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