File::Path::Copy

A Raku module for recursively copying or deleting files.

File::Path::Copy

Module File::Path::Copy

Table of Contents

NAME

File::Path::Copy

AUTHOR

Francis Grizzly Smit ([email protected])

VERSION

v0.1.14

TITLE

File::Path::Copy

SUBTITLE

A Raku module for recursively copying or deleting files.

COPYRIGHT

GPL V3.0+ LICENSE

Top of Document

Introduction

This is a Raku module to recursively copy or delete files.

Motivation

None of the other modules I tried worked so here is mine.

Table of Contents

sub copypath(...) is export

sub copypath(IO::Path $from, IO::Path $to,
                Bool:D :d(:$dontrecurse) = False, Bool:D :c(:$createonly) = False,
                Bool:D :n(:$no-to-check) = False, Bool:D :$backtrace = False,
                Bool:D :$noErrorMessages = False --> Bool:D) is export

Copy the $from path to the $to path recursively by default.

Where

  • $from The path to copy from.

  • $to The path to copy to.

  • :d :$dontrecurse Don't copy recursively, by default it will copy recursively.

  • :c :$createonly Makes it an Error to try to overwrite a file.

  • :n :$no-to-check Don't do the check on whether the to file is the same as the source.

    • i.e. normally will check if $from.basename eq $to.basename if so then will try to copy $from/* into $to/* note this includes . files; if this is true will not do this.

  • :$backtrace Show backtrace messages for any error messages.

  • :$noErrorMessages Don't show error messages.

Table of Contents

sub prunepath(...) is export

sub prunepath(IO::Path $path, Bool:D :$backtrace = False,
                Bool:D :$noErrorMessages = False --> Bool:D) is export

Remove a path and everything under it.

Where

  • $path The path to prune.

  • :$backtrace If true then write backtrace to any error messages. item1 :$noErrorMessages Don't show error messages.

Table of Contents

sub emptypath(...) is export

sub emptypath(IO::Path $path, Bool:D :$backtrace = False,
                Bool:D :$noErrorMessages = False --> Bool:D) is export

Remove everything under a path, but leave the path.

Where

  • $path The path to prune.

  • :$backtrace If true then write backtrace to any error messages. item1 :$noErrorMessages Don't show error messages.

Table of Contents

File::Path::Copy v0.1.14

A Raku module for recursively copying or deleting files.

Authors

  • Francis Grizzly Smit

License

LGPL-3.0-or-later

Dependencies

Test Dependencies

Provides

  • File::Path::Copy

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.