Debian Codegraph @

README

raw
1 NAME
2
3 File::lchown - modify attributes of symlinks without dereferencing them
4
5 SYNOPSIS
6
7 use File::lchown qw( lchown lutimes );
8
9 lchown $uid, $gid, $linkpath or die "Cannot lchown() - $!";
10
11 lutimes $atime, $mtime, $linkpath or die "Cannot lutimes() - $!";
12
13 DESCRIPTION
14
15 The regular chown system call will dereference a symlink and apply
16 ownership changes to the file at which it points. Some OSes provide
17 system calls that do not dereference a symlink but instead apply their
18 changes directly to the named path, even if that path is a symlink (in
19 much the same way that lstat will return attributes of a symlink rather
20 than the file at which it points).
21
22 FUNCTIONS
23
24 lchown
25
26 $count = lchown $uid, $gid, @paths;
27
28 Set the new user or group ownership of the specified paths, without
29 dereferencing any symlinks. Passing the value -1 as either the $uid or
30 $gid will leave that attribute unchanged. Returns the number of files
31 successfully changed.
32
33 lutimes
34
35 $count = lutimes $atime, $mtime, @paths;
36
37 Set the access and modification times on the specified paths, without
38 dereferencing any symlinks. Passing undef as both $atime and $mtime
39 will update the times to the current system time.
40
41 Note that for both lchown and lutimes, if more than one path is given,
42 if later paths succeed after earlier failures, then the value of $!
43 will not be reliable to indicate the nature of the failure. If you wish
44 to use $! to report on failures, make sure only to pass one path at a
45 time.
46
47 Since version 0.03 either time may be given as a fractional value, or
48 as an ARRAY reference containing at least two elements. In the latter
49 case, the [0] element should contain the integer seconds and [1] the
50 microseconds part of it; in the same style as Time::HiRes.
51
52 SEE ALSO
53
54 * lchown(2) - change ownership of a file
55
56 * lutimes(2) - change file timestamps
57
58 AUTHOR
59
60 Paul Evans <[email protected]>
61