IO::Path::ChildSecure -Secure version of IO::Path.child
# good; you get IO::Path
# still good if 'foo/meow/foo/bar/../' exists; Failure if it doesn't
# bad; path isn't a child; you get Failure
In the Raku Programming Language v6.c,
secure, in a sense that it does no checks for whether the resultant path is
actually a child of the original path.
"foo".IO.&child-secure: 'meow'; # good; you get IO::Path
"foo".IO.&child-secure: 'meow/foo/bar/../meow'; # still good
"foo".IO.&child-secure: '../'; # bad; path isn't a child; you get Failure
child-secure "foo".IO, '../'; # can also use as a proper sub
Appends the given path chunk to the invocant and ensures the resultant path
is, in fact, a child of the invocant, by accessing the filesystem and
fully-resolving the path. The last chunk of the resultant path does not have
to exist for the resolution to succeed.
failed to fully resolve the resultant path
X::IO::NotAChild if the resultant path is not a child of the invocant.
- Module requires Rakudo 2017.04 or newer and will
die on earlier versions
(more specifically, anything earlier than dev version
- If you don't need to ensure secureness, use the much-faster core
Fork this module on GitHub:
To report bugs or request features, please use
Zoffix Znet (http://perl6.party/)
You can use and distribute this module under the terms of the
The Artistic License 2.0. See the
LICENSE file included in this
distribution for complete details.
META6.json file of this distribution may be distributed and modified
without restrictions or attribution.