[Pharo-dev] 19609 FileReference>>base should be before last separator

Stephane Ducasse stepharo.self at gmail.com
Thu Aug 17 11:08:40 EDT 2017


I do not know but I imagine that I added basenameWithoutExtension because
I found the name much much clearer. I would have never guessed that
base is the basename without the extension.

Stef

On Wed, Aug 16, 2017 at 9:46 PM, Alistair Grant <akgrant0710 at gmail.com> wrote:
> Hi All,
>
> I've just taken a look at issue 19609 FileReference>>base should be
> before last separator and wonder whether it is a correct interpretation
> of the original intentions.
>
> The original author of the issue, Michael, seems to feel that
> FileReferene>>base and FileReference>>basenameWithoutExtension are the
> same.
>
> My reading of the comments is that they perform a different function,
> i.e.:
>
>
> '/a/b/c.d.e' asFileReference base.  "c"
> '/a/b/c.d.e' asFileReference basenameWithoutExtension.  "c.d"
>
>
> are both the expected values, i.e.:
>
> - #base answers the name up to the first extensionDelimiter.
> - #basenameWithoutExtension answers the name without what is typically
>   considered the file extension (the bit after the last
>   extensionDelimiter).
>
> Not shown above, but:
>
> - #basename answers the entire filename, i.e. "c.d.e".
>
>
> Does anyone know the history of these methods?
>
>
> Cheers,
> Alistair
>



More information about the Pharo-dev mailing list