lkml.org 
[lkml]   [1996]   [Jul]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: How does chown(2) works with symlinks?
Date
>The chown(2) syscall should follow the link(s).  The OS provides another
>call, lchown(2), for operating directly on a symlink (some also
>provide a lchmod(2), such as SCO's OpenServer). There is also a
>lstat(2).

That does make some sense if one is starting from scratch, but we are
talking about Unix here. lchown(2) generally isn't available.
Consequently, if you want chown(1) -R to do something useful, chown(2)
can't follow the link. Like Linus said, use open(2) and fchown(2) if
you want that behaviour -- that's the portable way to do it.

-zefram


\
 
 \ /
  Last update: 2005-03-22 13:38    [W:0.066 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site