[lkml]   [1996]   [Jul]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: How does chown(2) works with symlinks?
>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

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.


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