See Original text in context
method rel2abs(|c --> List)
Same as IO::Spec::Win32.rel2abs
, except replaces backslashes with slashes in the final result.
See Original text in context
method rel2abs(Str() , = --> Str)
Returns a string representing $path
converted to absolute path, based at $base
, which defaults to $*CWD
. If $base
is not an absolute path, it will be made absolute relative to $*CWD
, unless $*CWD
and $base
are the same.
say ; # OUTPUT: «"C:\Users\camelia".IO»say IO::Spec::Win32.rel2abs: 'foo'; # OUTPUT: «C:\Users\camelia\foo»say IO::Spec::Win32.rel2abs: './'; # OUTPUT: «C:\Users\camelia»say IO::Spec::Win32.rel2abs: 'foo/../../'; # OUTPUT: «C:\Users\camelia\foo\..\..»say IO::Spec::Win32.rel2abs: '/foo/'; # OUTPUT: «C:\foo»say IO::Spec::Win32.rel2abs: 'foo', 'bar'; # OUTPUT: «C:\Users\camelia\bar\foo»say IO::Spec::Win32.rel2abs: './', '/bar'; # OUTPUT: «\bar»say IO::Spec::Win32.rel2abs: '/foo/', 'bar'; # OUTPUT: «C:\foo»say IO::Spec::Win32.rel2abs: 'foo/../../', 'bar';# OUTPUT: «C:\Users\camelia\bar\foo\..\..»
See Original text in context
method rel2abs(Str() , = --> Str)
Returns a string representing $path
converted to absolute path, based at $base
, which defaults to $*CWD
. If $base
is not an absolute path, it will be made absolute relative to $*CWD
, unless $*CWD
and $base
are the same.
say ; # OUTPUT: «"/home/camelia".IO»say IO::Spec::Unix.rel2abs: 'foo'; # OUTPUT: «/home/camelia/foo»say IO::Spec::Unix.rel2abs: './'; # OUTPUT: «/home/camelia»say IO::Spec::Unix.rel2abs: 'foo/../../'; # OUTPUT: «/home/camelia/foo/../..»say IO::Spec::Unix.rel2abs: '/foo/'; # OUTPUT: «/foo»say IO::Spec::Unix.rel2abs: 'foo', 'bar'; # OUTPUT: «/home/camelia/bar/foo»say IO::Spec::Unix.rel2abs: './', '/bar'; # OUTPUT: «/bar»say IO::Spec::Unix.rel2abs: '/foo/', 'bar'; # OUTPUT: «/foo»say IO::Spec::Unix.rel2abs: 'foo/../../', 'bar';# OUTPUT: «/home/camelia/bar/foo/../..»