Lchown(3pm)

Lchown3pm

Use the lchown(2) system call from perl

Usage

  use Lchown;
  lchown $uid, $gid, 'foo' or die "lchown: $!";
  my $count = lchown $uid, $gid, @filenames;
  # or
  
  use Lchown qw(lchown LCHOWN_AVAILABLE);
  warn "this system lacks the lchown system call\n" unless LCHOWN_AVAILABLE;
  ...
  # or
  
  use Lchown ();
  warn "this won't work\n" unless Lchown::LCHOWN_AVAILABLE;
  Lchown::lchown $uid, $gid, 'foo' or die "lchown: $!";

Overview

Provides a perl interface to the lchown() system call, on platforms that support it.

Default exports

The following symbols are exported be default:

lchown (LIST)

Like the "chown" builtin, but using the lchown() system call so that symlinks will not be followed. Returns the number of files successfully changed.

On systems without the lchown() system call, "lchown" always returns "undef" and sets "errno" to "ENOSYS" (Function not implemented).

Additional exports

The following symbols are available for export but are not exported by default:

LCHOWN_AVAILABLE ()

Returns true on platforms with the lchown() system call, and false on platforms without.

Releases

9 releases since Debian 6.0 (Squeeze); the text changed 8 times.

  1. 6.0
  2. 7
  3. 8
  4. 9
  5. 10
  6. 11
  7. 12
  8. 13
  9. Arch

Author

Nick Cleaton <[email protected]>

From perl-lchown 1.01-19 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.