-
-
10 Sep 2015 10:18:29 UTC
- Distribution: File-chown
- Module version: 0.02
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues
- Testers (1318 / 0 / 3)
- Kwalitee
Bus factor: 1- % Coverage
- License: perl_5
- Perl: v5.10.1
- Activity
24 month- Tools
- Download (13.42KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- none
- Reverse dependencies
- CPAN Testers List
- Dependency graph
- NAME
- VERSION
- SYNOPSIS
- DESCRIPTION
- FUNCTIONS
- SEE ALSO
- HOMEPAGE
- SOURCE
- BUGS
- AUTHOR
- COPYRIGHT AND LICENSE
NAME
File::chown - chown which groks user-/group names and some other extra features
VERSION
This document describes version 0.02 of File::chown (from Perl distribution File-chown), released on 2015-09-10.
SYNOPSIS
use File::chown; # exports chown() by default # chown by user-/group names chown "ujang", "ujang", @files; # numeric ID's still work chown -1, 500, "myfile.txt"; # option: use a reference file's owner/group instead of specifying directly, # like the Unix chown command's --reference=FILE. chown({ref => "/etc/passwd"}, "mypasswd"); # option: use lchown instead of chown, like Unix chown command's --no-derefence # (-h). chown({deref=>0}, "nobody", "nobody", "/home/user/www");
DESCRIPTION
File::chown provides
chown()
which overloads the core version with one that groks user-/group names, as well as some other extra features.FUNCTIONS
chown([ \%opts, ] LIST) => bool
Changes the owner (and group) of a list of files. Like the core version of
chown()
, The first two elements of the list must be$user
and$group
which can be numeric ID's (or -1 to mean unchanged) or string which will be looked up usinggetpwnam
andgetgrnam
. Function will die if lookup fails.It accepts an optional first hashref argument containing options. Known options:
ref => str
Like
--reference
option in thechown
Unix command, meaning to get$user
and$group
from a specified filename instead of from the first two elements of the argument list.deref => bool (default: 1)
If set to 0 then, like the
--no-dereference
(-h
) option of thechown
Unix command, will use File::lchown instead of the corechown()
. This is to set ownership of a symlink itself instead of the symlink target.
SEE ALSO
chown
in perlfuncThe
chown
Unix commandHOMEPAGE
Please visit the project's homepage at https://metacpan.org/release/File-chown.
SOURCE
Source repository is at https://github.com/perlancar/perl-File-chown.
BUGS
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=File-chown
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
AUTHOR
perlancar <perlancar@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2015 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Module Install Instructions
To install File::chown, copy and paste the appropriate command in to your terminal.
cpanm File::chown
perl -MCPAN -e shell install File::chown
For more information on module installation, please visit the detailed CPAN module installation guide.