The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

File::Ownership::Unix - A object oriented system for working with file ownership under unix.

VERSION

Version 0.0.0

SYNOPSIS

    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');

METHODS

new

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);
    }

chown

This chowns the specified file.

    $foo->chown('/tmp/foo');
    if( $foo->error ){
        warn('error:'.$foo->error.': '.$foo->errorString);
    }

getGID

This returns the currently set GID.

    my $gid=$foo->getGID;

getUID

This returns the currently set UID.

    my $gid=$foo->getGID;

setGID

This sets the current GID.

    $foo->setGID('1001');
    if( $foo->error ){
        warn('error:'.$foo->error.': '.$foo->errorString);
    }

setUID

This sets the current UID.

    $foo->setUID('1001');
    if( $foo->error ){
        warn('error:'.$foo->error.': '.$foo->errorString);
    }

setFromFile

This sets the current [GU]ID from the specified file.

        $foo->setFromFile('/tmp/foo');
    if( $foo->error ){
        warn('error:'.$foo->error.': '.$foo->errorString);
    }

ERROR CODES

1

Invalid value for a [GU]ID.

2

No file specified.

3

The specified file does not exist.

4

Failed to cown the specified file.

AUTHOR

Zane C. Bowers-Hadley, <vvelox at vvelox.net>

BUGS

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.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc File::Ownership::Unix

You can also look for information at:

ACKNOWLEDGEMENTS

LICENSE AND COPYRIGHT

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.