MOBY

 view release on metacpan or  search on metacpan

bin/scripts/moby-s-caching.pl  view on Meta::CPAN

		exit(0);
	}

	sub say { print @_; }

}

use English qw( -no_match_vars );
use strict;

# performs a chown on a list of files and then returns the number of changed files
sub chown_by_name {
	return 0 if (MSWIN);
	my ( $uid, $guid, @files ) = @_;
	return chown($uid, $guid, @files );
}

# performs a chmod on a list of files and returns the number of changed files
# UGO == UG{rw}, O{r}
sub chmod_by_name {
	my (@files) = @_;
	my $mode = 0664;
	return chmod $mode, @files;
}

bin/scripts/moby-s-caching.pl  view on Meta::CPAN

$x = MOBY::RDF::Ontologies::Cache::ServiceCache->new(
			endpoint  => $registry_url,
			cache     => $cache_dir,
);
$x->create_service_cache();
say"done!\n\n";
say "Setting permissions for the cache ...\n";
my $dirs = $x->{utils}->get_cache_dirs();
while ( my ( $key, $value ) = each( %{$dirs} ) ) {    
	say "\tUpdating permissions for '$value' ...\n";
	say "\t\tchown of $value: " . chown_by_name($uid, $gid, $value) . " files updated.\n";
	say "\t\tchown of all files in $value: " . chown_by_name($uid, $gid, <$value/*>) . " files updated.\n";
} 

say "Done!\n";

__END__



( run in 0.563 second using v1.01-cache-2.11-cpan-71847e10f99 )