develooper Front page | perl.perl6.users | Postings from December 2019

Re: rmdir question

Thread Previous | Thread Next
From:
Timo Paulssen
Date:
December 3, 2019 17:56
Subject:
Re: rmdir question
Message ID:
a9e700b7-5f49-9c35-eaef-b41db0484a2a@wakelift.de
On 03/12/2019 04:46, Paul Procacci wrote:
> On success it return a Bool::True.
> On failure it throws an exception.
> It doesn't crash the program.
> If you are interested in handling the exception, add logic to handle it.
>
> Examples:
> ---------------------------
> # mkdir a ; `which perl6` -e "'a'.IO.rmdir.perl.say"
> Bool::True
> # mkdir a ; `which perl6` -e "'b'.IO.rmdir.perl.say"
> Failure.new(exception => X::IO::Rmdir.new(path => "/root/test/b",
> os-error => "Failed to rmdir: no such file or directory"), backtrace
> => Backtrace.new)
> # mkdir a ; `which perl6` -e "try { 'b'.IO.rmdir.perl.say; CATCH {
> default { 'tsk tsk'.say }}}"
> tsk tsk


Hi Paul,

thanks to your email I found and fixed an oversight in the Raku docs:

it says it throws an exception, when actually it returns a Failure.

Thank you!
  - Timo

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About