From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id pBRGTTol006383 for ; Tue, 27 Dec 2011 17:29:29 +0100 X-IronPort-AV: E=Sophos;i="4.71,416,1320620400"; d="scan'208";a="137002552" Received: from macadam.inria.fr ([128.93.8.130]) by mail1-relais-roc.national.inria.fr with ESMTP/TLS/AES128-SHA; 27 Dec 2011 17:29:24 +0100 From: Damien Doligez Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Tue, 27 Dec 2011 17:29:24 +0100 Message-Id: To: caml users Mime-Version: 1.0 (Apple Message framework v1084) X-Mailer: Apple Mail (2.1084) Subject: [Caml-list] RFC: basename, dirname, PR#4549 Hello, I would like to get some comments from the OCaml community at large about the problem raised in http://caml.inria.fr/mantis/view.php?id=4549 In a nutshell, the problem is that our version of basename and dirname are not exactly the same as the Open Group's definition. We can easily implement the standard behaviour for basename and dirname, and it seems desirable, but there is a catch: we will have to change the specification of the standard library slightly. Currently, we specify this: [concat (dirname name) (basename name)] returns a file name which is equivalent to [name]. Moreover, after setting the current directory to [dirname name] (with {!Sys.chdir}), references to [basename name] (which is a relative file name) designate the same file as [name] before the call to {!Sys.chdir}. With the Open Group basename and dirname, this becomes false for names that include some trailing slashes, because such slashes are removed by basename. This means that a name "foo/bar/" becomes "foo/bar" when put through [concat (dirname name) (basename name)] and opening "foo/bar" may succeed if it is a file, while opening "foo/bar/" would fail. I would like to know if anyone relies on the precise behaviour documented in the standard library, and for everyone else, would you prefer the old behaviour or the new (standard) behaviour? -- Damien