method catpath
1 | class IO::Spec::Cygwin |
1.1 | (IO::Spec::Cygwin) method catpath |
2 | class IO::Spec::Unix |
2.1 | (IO::Spec::Unix) method catpath |
3 | class IO::Spec::Win32 |
3.1 | (IO::Spec::Win32) method catpath |
Documentation for method catpath
assembled from the following types:
class IO::Spec::Cygwin
From IO::Spec::Cygwin
(IO::Spec::Cygwin) method catpath
Defined as:
method catpath (Str , Str , Str --> Str)
Same as IO::Spec::Win32.catpath
, except will also change all backslashes to slashes at the end:
IO::Spec::Cygwin.catpath('C:', '/some/dir', 'foo.txt').say;# OUTPUT: «C:/some/dir/foo.txt»IO::Spec::Cygwin.catpath('C:', '/some/dir', '').say;# OUTPUT: «C:/some/dir»IO::Spec::Cygwin.catpath('', '/some/dir', 'foo.txt').say;# OUTPUT: «/some/dir/foo.txt»IO::Spec::Cygwin.catpath('E:', '', 'foo.txt').say;# OUTPUT: «E:foo.txt»
class IO::Spec::Unix
From IO::Spec::Unix
(IO::Spec::Unix) method catpath
Defined as:
method catpath ($, Str , Str --> Str)
Takes two path fragments and concatenates them, adding or removing a path separator, if necessary. The first argument is ignored (it exists to maintain consistent interface with other IO::Spec|/type/IO::Spec
types for systems that have volumes).
IO::Spec::Unix.catpath($, 'some/dir', 'and/more').say;# OUTPUT: «some/dir/and/more»
class IO::Spec::Win32
From IO::Spec::Win32
(IO::Spec::Win32) method catpath
Defined as:
method catpath (Str , Str , Str --> Str)
Concatenates a path from given volume, a chain of directories, and file. An empty string can be given for any of the three arguments. No attempt to make the path canonical is made. Use canonpath
for that purpose.
IO::Spec::Win32.catpath('C:', '/some/dir', 'foo.txt').say;# OUTPUT: «C:/some/dir\foo.txt»IO::Spec::Win32.catpath('C:', '/some/dir', '').say;# OUTPUT: «C:/some/dir»IO::Spec::Win32.catpath('', '/some/dir', 'foo.txt').say;# OUTPUT: «/some/dir\foo.txt»IO::Spec::Win32.catpath('E:', '', 'foo.txt').say;# OUTPUT: «E:foo.txt»