From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id C8614BC6B for ; Wed, 5 Sep 2007 13:10:19 +0200 (CEST) Received: from smtp.syd.people.net.au (smtp.syd.people.net.au [218.214.225.98]) by concorde.inria.fr (8.13.6/8.13.6) with SMTP id l85BAGgU005594 for ; Wed, 5 Sep 2007 13:10:18 +0200 Received: (qmail 10148 invoked from network); 5 Sep 2007 11:10:29 -0000 Received: from unknown (HELO hendrix.mega-nerd.net) (218.214.64.136) by smtp.syd.people.net.au with SMTP; 5 Sep 2007 11:10:29 -0000 Received: from hendrix (hendrix [192.168.200.99]) by hendrix.mega-nerd.net (Postfix) with SMTP id 71E3C2FB82 for ; Wed, 5 Sep 2007 21:10:13 +1000 (EST) Date: Wed, 5 Sep 2007 21:10:13 +1000 From: Erik de Castro Lopo To: caml-list@inria.fr Subject: Re: [Caml-list] Bug in Filename.basename? Message-Id: <20070905211013.b53cf46b.mle+ocaml@mega-nerd.com> In-Reply-To: <20070905104127.GB24323@furbychan.cocan.org> References: <20070905184538.88ada4e8.mle+ocaml@mega-nerd.com> <20070905104127.GB24323@furbychan.cocan.org> Organization: Erik Conspiracy Secret Labs X-Mailer: Sylpheed 2.3.1 (GTK+ 2.10.11; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-j-chkmail-Score: MSGID : 46DE8E98.005 on concorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at concorde with ID 46DE8E98.005 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 bug:01 basename:01 ocaml:01 basename:01 ocaml's:01 bug:01 ocaml's:01 wikipedia:01 wiki:01 wikipedia:01 wiki:01 wrote:01 matched:01 caml-list:01 Richard Jones wrote: > I think the OCaml one is what I'd reasonably expect actually. > > The GNU documentation for basename says: > > `basename' removes any leading directory components from NAME. > > and a/b/c/ are leading directory components. The word "leading" in the above is at best, ambiguous. Regardless of what the documentation says, the behaviour of Ocaml's basename function is different from the basename program (from the GNU coreutils package) on my Linux system. Since I suspect that the basename function is meant to emulate the basename program I see the Ocaml function's behaviour as a bug. I would however discount this if the behaviour of basename on some other commonly used system (eg *BSD) matched the Ocaml behaviour. However, here is a comparison chart of what I have tested so far: "a/b/c" "a/b/c/" Linux basename "c" "c" Mac OSX basename "c" "c" Ocaml Filename.basename "c" "." The behaviour of Ocaml's Filename.basename is the same on Linux and Mac OSX. Erik -- ----------------------------------------------------------------- Erik de Castro Lopo ----------------------------------------------------------------- http://en.wikipedia.org/wiki/Why_I_Am_Not_a_Christian http://en.wikipedia.org/wiki/Why_I_Am_Not_a_Muslim http://en.wikipedia.org/wiki/Strong_atheism