Subsets::IO- Subsets for various types ofIO::Path` instances
use Subsets::IO;
say "Our script is writable and readable"
if $*PROGRAM ~~ IO::Path::frw;use Subsets::IO;
sub make-conf($conf where IO::Path::dw | IO::Path::fw) {
say "$conf is either a writable directory or a writable file";
}
sub make-conf-file(IO::Path::E $conf) {
say "$conf is a non-existent path";
}
make-conf-file $*PROGRAM;
# Path must NOT exist Got /home/zoffix/CPANPRC/Subsets-IO/foo.p6
# Constraint type check failed in binding to parameter '$conf';
# expected IO::Path::E but got IO::Path (IO::Path.new("/home/z...)The Subsets::IO distribution provides subsets of IO::Path:D that additionally perform file tests, using the will complain feature to display useful error messages on typecheck failures.
Path must exist.
Path must NOT exist.
Path must be an existing file.
Path must NOT be an existing file.
Path must be an existing directory.
Path must NOT be an existing directory.
Path must be an existing, readable file.
Path must be an existing, readable and writable file.
Path must be an existing, readable and executable file.
Path must be an existing, writeable and executable file.
Path must be an existing, readable, writable, and executable file.
Path must be an existing, readable directory.
Path must be an existing, readable and writable directory.
Path must be an existing, readable and executable directory.
Path must be an existing, writeable and executable directory.
Path must be an existing, readable, writable, and executable directory.
Zoffix Znet
Copyright 2018 Zoffix Znet
Copyright 2019 - 2022, 2025, 2026 Raku Community
This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.