Documentation for method add

Documentation for method add, assembled from the following types:

class IO::Path

From IO::Path

(IO::Path) method add

Defined as:

method add(IO::Path:D: Str() $what --> IO::Path:D)

Concatenates a path fragment to the invocant and returns the resultant IO::Path.

"foo/bar".IO.mkdir;
"foo/bar".IO.add("meow")    .resolve.relative.say# OUTPUT: «foo/bar/meow␤» 
"foo/bar".IO.add("/meow")   .resolve.relative.say# OUTPUT: «foo/bar/meow␤» 
"foo/bar".IO.add("meow.txt").resolve.relative.say# OUTPUT: «foo/bar/meow.txt␤» 
"foo/bar".IO.add("../meow".resolve.relative.say# OUTPUT: «foo/meow␤» 
"foo/bar".IO.add("../../")  .resolve.relative.say# OUTPUT: «.␤»