Path.pm6 (rakudo-2020.09) | : | Path.pm6 (rakudo-2020.10) | ||
---|---|---|---|---|
skipping to change at line 451 | skipping to change at line 451 | |||
:os-error(':createonly specified and destination exists'); | :os-error(':createonly specified and destination exists'); | |||
nqp::rename($.absolute, nqp::unbox_s($to.absolute)); | nqp::rename($.absolute, nqp::unbox_s($to.absolute)); | |||
CATCH { default { | CATCH { default { | |||
fail X::IO::Rename.new: | fail X::IO::Rename.new: | |||
:from($!os-path), :to($to.absolute), :os-error(.Str); | :from($!os-path), :to($to.absolute), :os-error(.Str); | |||
}} | }} | |||
} | } | |||
method copy(IO::Path:D: IO() $to, :$createonly --> True) { | method copy(IO::Path:D: IO() $to, :$createonly --> True) { | |||
# add fix for issue #3971 where attempt to copy a dir | ||||
# to a file clobbers the file. | ||||
self.d and $to.f and fail X::IO::Copy.new: | ||||
:from($.absolute), | ||||
:to($to.absolute), | ||||
:os-error('cannot copy a directory to a file'); | ||||
$createonly and $to.e and fail X::IO::Copy.new: | $createonly and $to.e and fail X::IO::Copy.new: | |||
:from($.absolute), | :from($.absolute), | |||
:to($to.absolute), | :to($to.absolute), | |||
:os-error(':createonly specified and destination exists'); | :os-error(':createonly specified and destination exists'); | |||
# XXX TODO: maybe move the sameness check to the nqp OP/VM | # XXX TODO: maybe move the sameness check to the nqp OP/VM | |||
nqp::if( | nqp::if( | |||
nqp::iseq_s( | nqp::iseq_s( | |||
(my $from-abs := $.absolute), | (my $from-abs := $.absolute), | |||
(my $to-abs := $to.absolute)), | (my $to-abs := $to.absolute)), | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 7 lines changed or added |