Sys::Config::Manage::Perms - Handles file permissions for files in a configuration directory.
Version 0.0.0
use Sys::Config::Manage::Perms; my $foo = Sys::Config::Manage::Perms->new(); ...
This initiates the object.
One argument is required and it is a hash reference.
This is a initiated Sys::Config::Manage object.
Default value to use for the mode.
If not specified, it defaults to '0644'.
$foo=Sys::Config::Manage::Perms->new(\%args); if($foo->error){ warn('error:'.$foo->error.': '.$foo->errorString); }
This syncs the file permissions down from the configuration directory to the system.
Two arguments can be used.
The first is the configuration directory. If not specified, it will be automaticallly choosen.
The second is the files to sync. If not specifiedm, all files will be synced.
#sync the specified files $foo->downSync( $configDir, \@files); if($foo->error){ warn('error:'.$foo->error.': '.$foo->errorString); } #syncs all the files $foo->downSync( $configDir ); if($foo->error){ warn('error:'.$foo->error.': '.$foo->errorString); }
This retrieves the mode for a file.
Two arguments are taken.The first is the configuration directory, which if not defined is automatically chosen. The second is the file in question.
my $mode=$foo->getPerms( $configDir, $file ); if($foo->error){ warn('error:'.$foo->error.': '.$foo->errorString); }
This lists the various config files that are being tracked that actually have a value specified.
Not all files returned by Sys::Config::Manage->listConfigFiles will have a value specified.
my @files=$foo->listConfigFiles; if($foo->error){ warn('error:'.$foo->error.': '.$foo->errorString); }
This sets the permissions for a file. This does require the numeric value.
Three arguments are taken.
The first one is the configuration directory to use. If none is specified, it will automatically be choosen.
The second is the config file to add the perms for.
The third numeric value for the permissions.
$foo->setPerms($configDir, $file, '0640'); if($foo->error){ warn('error:'.$foo->error.': '.$foo->errorString); }
This sets the permissions for a file, from a already existing file.
$foo->setPermsFromFile($configDir, $file); if($foo->error){ warn('error:'.$foo->error.': '.$foo->errorString); }
This syncs the file permissions up from the file system to configuration directory.
#sync the specified files $foo->upSync( $configDir, \@files); if($foo->error){ warn('error:'.$foo->error.': '.$foo->errorString); } #syncs all the files $foo->upSync( $configDir ); if($foo->error){ warn('error:'.$foo->error.': '.$foo->errorString); }
Nothing passed for the Sys::Config::Manage object.
$args{scm} is not a Sys::Config::Manage object.
Invalid configuration directory name.
The configuration directory does not exist.
Sys::Config::Manage->selectConfigDir errored.
Sys::Config::Manage->validConfigDirName errored.
No filename specified.
The specified file does not exist under the configuration directory.
The specified file does not exist on the file system.
The file specified file is under the base directory.
No value for the permissions specified.
The value specified for the permissions does not appear to be valid.
Validity is checked via the regexp below.
/^[01246][01234567][01234567][01234567]$/
The ".SysConfigManage" directory does not exist and could not be created.
The ".SysConfigManage/Perms" directory does not exist and could not be created.
Unable to opens the permissions file.
The add command failed.
Zane C. Bowers-Hadley, <vvelox at vvelox.net>
<vvelox at vvelox.net>
Please report any bugs or feature requests to bug-sys-config-manage-perms at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Sys-Config-Manage-Perms. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-sys-config-manage-perms at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Sys::Config::Manage::Perms
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Sys-Config-Manage
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Sys-Config-Manage
CPAN Ratings
http://cpanratings.perl.org/d/Sys-Config-Manage
Search CPAN
http://search.cpan.org/dist/Sys-Config-Manage/
Copyright 2011 Zane C. Bowers-Hadley.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Sys::Config::Manage, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Sys::Config::Manage
CPAN shell
perl -MCPAN -e shell install Sys::Config::Manage
For more information on module installation, please visit the detailed CPAN module installation guide.