Lchmod

 view release on metacpan or  search on metacpan

lib/Lchmod.pm  view on Meta::CPAN

Lchmod - use the lchmod() system call from Perl

=head1 VERSION

This document describes Lchmod version 0.02

=head1 SYNOPSIS

    use Lchmod;

    chmod(0600, $symlink) || die "Could not chown “$symlink”: $!\n";

    # $symlink is 0777, its target is 0600

    lchmod(0644, $symlink) || die "Could not lchown “$symlink”: $!\n";

    # $symlink is 0644, its target remains at 0600

=head1 DESCRIPTION

Similar to L<Lchown> but for setting a symlink’s mode instead of uid/gid.

lchmod() behaves like chmod() except that when given a symlink it operates on the symlink instead of the target.

=head1 INTERFACE

=head2 lchmod()

Takes a mode and list of files (just like L<chmod()>).

Returns the count of items that were succesfully modified (just like L<chmod()>).

Returns undef and sets $! to ENOSYS (just like L<chmod()>) when the system does not support lchown.

It is automatically imported and importable (just like L<Lchown>).

=head2 LCHMOD_AVAILABLE()

Exportable availabilty–check similar to what L<Lchown> provides.

Takes no arguments, returns true when lchmod() is available, false when it is not.

=head1 DIAGNOSTICS

Throws no errors or warnings of its own.

=head1 CONFIGURATION AND ENVIRONMENT

Lchmod requires no configuration files or environment variables.



( run in 0.667 second using v1.01-cache-2.11-cpan-71847e10f99 )