Meta
view release on metacpan or search on metacpan
Meta/Baseline/Rsh.pm view on Meta::CPAN
my($scod);
Meta::Utils::File::File::load($resu,\$scod);
if($scod) {
$code=$scod;
}
Meta::Utils::File::Remove::rm_soft($temp);
Meta::Utils::File::Remove::rm_soft($resu);
if($code) {
for(my($i)=0;$i<$numb;$i++) {
my($curr)=$targ->[$i];
Meta::Utils::File::Prop::chown_curr($curr);
Meta::Utils::File::Remove::rm($curr);
}
} else {
for(my($i)=0;$i<$numb;$i++) {
my($curr)=$targ->[$i];
Meta::Utils::File::Prop::chown_curr($curr);
Meta::Utils::File::Prop::chmod_rgw($curr);
}
}
$foun=1;
}
}
if(!$foun) { # machine not found
throw Meta::Error::Simple("unknown machine [".$host."]");
}
Meta::Utils::Output::verbose($verb,"data is [".$demo."] [".$verb."] [".$host."] [".$comm."] [".$type."]\n");
Meta/Utils/File/Prop.pm view on Meta::CPAN
use strict qw(vars refs subs);
use File::stat qw();
use Meta::Utils::Utils qw();
use Meta::Utils::Output qw();
use Error qw(:try);
our($VERSION,@ISA);
$VERSION="0.31";
@ISA=qw();
#sub chown($$$);
#sub chown_curr($);
#sub chmod_r($);
#sub chmod_x($);
#sub chmod_agw($);
#sub chmod_rgw($);
#sub same_mode($$);
#sub stat($);
#sub size($);
#sub mode($);
#sub is_r($);
#sub TEST($);
#__DATA__
sub chown($$$) {
my($uidx,$gidx,$file)=@_;
if(!CORE::chown($uidx,$gidx,$file)) {
throw Meta::Error::Simple("unable to chown [".$file."] to [".$uidx.",".$gidx."]");
}
}
sub chown_curr($) {
my($file)=@_;
&chown(Meta::Utils::Utils::cuid(),Meta::Utils::Utils::cgid(),$file);
}
sub chmod_r($) {
my($file)=@_;
if(!CORE::chmod(0444,$file)) {
throw Meta::Error::Simple("unable to chmod file [".$file."] to [0444]");
}
}
sub chmod_x($) {
Meta/Utils/File/Prop.pm view on Meta::CPAN
This module eases setting permissions on files.
This module provides method to:
1. change ownerships on files.
2. change read/write/execute permissions on files.
3. get various pieces of info on the file using the stat function.
and other things.
=head1 FUNCTIONS
chown($$$)
chown_curr($)
chmod_r($)
chmod_x($)
chmod_agw($)
chmod_rgw($)
same_mode($$)
stat($)
size($)
mode($)
is_r($)
TEST($)
=head1 FUNCTION DOCUMENTATION
=over 4
=item B<chown($$$)>
This functions receives a uid and a gid and changes a certain files owner
to that uid and gid. The function dies if it cannot do so.
=item B<chown_curr($)>
Changes the owner id and group id of a certain file to the current group
id and owner id.
=item B<chmod_r($)>
This function makes a file read only (receives only one file as argument).
=item B<chmod_x($)>
( run in 0.715 second using v1.01-cache-2.11-cpan-5511b514fd6 )