Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

「rmdir」 documentation is a bit off #852

Closed
AlexDaniel opened this issue Aug 22, 2016 · 2 comments
Closed

「rmdir」 documentation is a bit off #852

AlexDaniel opened this issue Aug 22, 2016 · 2 comments
Labels
docs Documentation issue (primary issue type)

Comments

@AlexDaniel
Copy link
Member

sub    rmdir(IO $dir --> Bool)
method rmdir(IO::Path:D: --> Bool)

First of all, the sub form does not really return Bool:

 perl6 -e 'say rmdir ‘deletable’' # OUTPUT: []

And also it allows many dirs to be passed (source):

sub rmdir(*@filenames, :$SPEC = $*SPEC, :$CWD = $*CWD) {
    my @ok;
    for @filenames -> $file {
        @ok.push($file) if $file.IO(:$SPEC,:$CWD).rmdir;
    }
    @ok;
#    @filenames.grep( *.IO(:$SPEC,:$CWD).rmdir ).eager;
}

Also, it does not mention how to wipe a whole directory with all of its contents, I was looking at the documentation of rmdir for exactly this purpose. As of now, it looks like there is no easy way, but it would be great if we could cover some alternative solutions.

@AlexDaniel AlexDaniel added the docs Documentation issue (primary issue type) label Aug 22, 2016
@AlexDaniel
Copy link
Member Author

One of the possible solutions is rmtree from File::Directory::Tree.

@zoffixznet
Copy link
Contributor

This was resolved by 8de94c9 and IO grant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation issue (primary issue type)
Projects
None yet
Development

No branches or pull requests

2 participants