On Tue, 11 Jul 2017 07:21:06 -0700, jar...@viidakko.fi wrote:

> So if this is the case then I just need to check if IO.volume is defined and 
> add that to path before calling IO.absolute

Sounds like what you really want is .parent ( 
https://docs.perl6.org/type/IO::Path#method_parent ):

  E:\>perl6 -e "my $path = 'c:\foo\bar\file.txt'.IO; $path.parent.say; 
$path.parent.absolute.say"
  "c:\foo\bar".IO
  C:\foo\bar

There's also related method .add ( 
https://docs.perl6.org/type/IO::Path#method_add )

.basename is as you say, it returns the basename (as a Str) without the volume, 
so when you convert it to IO again and .absolute it, it uses whatever drive 
you're on to make up the full path. The shown behaviour is correct, so I'll 
close the ticket.

If you're still having issues, you can join our support chat and ask for help: 
https://webchat.freenode.net/?channels=#perl6

Cheers,
ZZ

Reply via email to