File::Ownership::Unix - A object oriented system for working with file ownership under unix.
Version 0.0.0
use File::Ownership::Unix; my $foo=File::Ownership::Unix->new( 1001, 1001 ); #gets the ownership info for a file $foo->setFromFile('/tmp/foo'); #chowns a file using the current [GU]ID $foo->chown('/tmp/bar'); #copies the ownership info from one file to another $foo->setFromFile('/tmp/foo'); $foo->chown('/tmp/bar');
This initiates the object.
There are two optional arguments taken. The first one is the UID and the second is the GID.
Both default to zero.
my $foo=File::Ownership::Unix->new; if( $foo->error ){ warn('error:'.$foo->error.': '.$foo->errorString); }
This chowns the specified file.
$foo->chown('/tmp/foo'); if( $foo->error ){ warn('error:'.$foo->error.': '.$foo->errorString); }
This returns the currently set GID.
my $gid=$foo->getGID;
This returns the currently set UID.
This sets the current GID.
$foo->setGID('1001'); if( $foo->error ){ warn('error:'.$foo->error.': '.$foo->errorString); }
This sets the current UID.
$foo->setUID('1001'); if( $foo->error ){ warn('error:'.$foo->error.': '.$foo->errorString); }
This sets the current [GU]ID from the specified file.
$foo->setFromFile('/tmp/foo'); if( $foo->error ){ warn('error:'.$foo->error.': '.$foo->errorString); }
Invalid value for a [GU]ID.
No file specified.
The specified file does not exist.
Failed to cown the specified file.
Zane C. Bowers-Hadley, <vvelox at vvelox.net>
<vvelox at vvelox.net>
Please report any bugs or feature requests to bug-file-ownership-unix at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=File-Ownership-Unix. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-file-ownership-unix at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc File::Ownership::Unix
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=File-Ownership-Unix
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/File-Ownership-Unix
CPAN Ratings
http://cpanratings.perl.org/d/File-Ownership-Unix
Search CPAN
http://search.cpan.org/dist/File-Ownership-Unix/
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 File::Ownership::Unix, copy and paste the appropriate command in to your terminal.
cpanm
cpanm File::Ownership::Unix
CPAN shell
perl -MCPAN -e shell install File::Ownership::Unix
For more information on module installation, please visit the detailed CPAN module installation guide.