std.path.buildPath

Patrick Schluter via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jun 4 10:05:56 PDT 2017


On Sunday, 4 June 2017 at 15:56:58 UTC, Jacob Carlborg wrote:
> On 2017-06-04 07:44, Jesse Phillips wrote:
>
>> What is your expected behavior? Throw an exception? You can't 
>> really
>> append an absolute path to another.
>
> Of course you can. I expect buildPath("/foo", "/bar") to result 
> in "/foo/bar". That's how Ruby behaves.

buildPath("/usr/bin", "/usr/bin/gcc")

/usr/bin/usr/bin/gcc is obviously wrong. I think the semantic is 
not as illogical as it seem at first glance.


More information about the Digitalmars-d-learn mailing list