Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Brian Hurt <bhurt@janestcapital.com>
To: Erik de Castro Lopo <mle+ocaml@mega-nerd.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Bug in Filename.basename?
Date: Wed, 05 Sep 2007 08:37:42 -0400	[thread overview]
Message-ID: <46DEA316.3010806@janestcapital.com> (raw)
In-Reply-To: <20070905211013.b53cf46b.mle+ocaml@mega-nerd.com>

[-- Attachment #1: Type: text/plain, Size: 1149 bytes --]

Erik de Castro Lopo wrote:

>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.
>  
>
Interesting point from the Linux basename man page:

>        There  are  two  different  versions  of basename() - the POSIX 
> version
>        described above, and the GNU version one gets after
>          #define _GNU_SOURCE
>          #include <string.h>
>        The GNU version never modifies its  argument,  and  returns  
> the  empty
>        string  when  path has a trailing slash, and in particular also 
> when it
>        is "/".  There is no GNU version of dirname().


So there seems to be some confusion, even at Gnu, as to what the proper 
behavior of this function should be.

Brian


[-- Attachment #2: Type: text/html, Size: 1936 bytes --]

  parent reply	other threads:[~2007-09-05 12:37 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-05  8:45 Erik de Castro Lopo
2007-09-05 10:41 ` [Caml-list] " Richard Jones
2007-09-05 11:10   ` Erik de Castro Lopo
2007-09-05 11:25     ` Oliver Bandel
2007-09-05 12:00       ` Erik de Castro Lopo
2007-09-05 13:06         ` Markus E L
2007-09-05 20:39         ` Oliver Bandel
2007-09-05 21:03           ` Oliver Bandel
2007-09-06  4:52           ` skaller
2007-09-06  7:09             ` Christophe Raffalli
2007-09-06  9:51             ` Oliver Bandel
2007-09-06  9:32           ` Markus E L
2007-09-06 10:00             ` Oliver Bandel
2007-09-05 12:15       ` Mattias Engdegård
2007-09-05 20:54         ` Oliver Bandel
2007-09-05 12:37     ` Brian Hurt [this message]
2007-09-05 13:06     ` Markus E L
2007-09-05 12:10   ` Olivier Andrieu

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=46DEA316.3010806@janestcapital.com \
    --to=bhurt@janestcapital.com \
    --cc=caml-list@inria.fr \
    --cc=mle+ocaml@mega-nerd.com \
    /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