Closed rwp0 closed 2 years ago
I don't think this needs a new method. There are a couple ways to do it, depending on the semantics you want:
# add the extension as child of the new parent
$path = path("/usr/local/lib")->child($extension);
# root a relative extension under an absolute path
$path = $extension->absolute("/usr/local/lib");
Currently the
parent
method returns the parent directory path (optionally to n-th degree with a numeric argument).Can we have a method similar to
child
that would set the parent instead?I needed such a method for my script, and didn't find it reading the documentation.
For instance:
Since it mostly just prepends (being the reverse of
child
), shouldn't be hard to implement I think.Thank you for the attention.