Conjury-Core
view release on metacpan or search on metacpan
lib/Conjury/Core.pm view on Meta::CPAN
filenames. The 'Directory' argument is required and must specify the
destination directory for the copy action.
Use the optional 'Factors' argument to add spells explicitly to the list of
factors. If there are already spells that produce the files in the 'File'
list, they need not be listed here. They will be fetched and automatically
appended to the factors list.
Use the optional 'Journal' argument to specify a journal object for the spell.
Use the optional 'Permission' argument to specify that the C<chmod> builtin
should be used to set the access permissions associated with the files after
they have been copied to the destination. The syntax requirements for
C<chmod> apply.
Use the optional 'Owner' argument to specify that the C<chown> builtin should
be used to set the user and group ownership after the files have been copied to
the destination. The syntax requirements for C<chown> apply.
=cut
sub filecopy {
my %arg = @_;
my $error = $prototype{_filecopy_f()}->validate(\%arg);
lib/Conjury/Core.pm view on Meta::CPAN
for (my $i = 0; $i < @$files; ++$i) {
print "syscopy $files->[$i] $product[$i]\n";
if (!$preview) {
File::Copy::syscopy($files->[$i], $product[$i])
|| do { return $! };
}
}
if (defined($permission)) {
my $valstr = sprintf "%o", $permission;
print "chmod $valstr $product_str\n";
if (!$preview) {
chmod($permission, @product) == @product
|| do {
my $result = $!;
unlink @product;
return $result;
};
}
}
if (defined($owner)) {
my ($user, $group) = @$owner;
( run in 0.916 second using v1.01-cache-2.11-cpan-496ff517765 )