Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

How do I change the owner:group of a symlink?

by v_thunder (Scribe)
on May 24, 2002 at 03:38 UTC ( #168970=perlquestion: print w/ replies, xml ) Need Help??
v_thunder has asked for the wisdom of the Perl Monks concerning the following question:

I am testing this on HP-UX 11.00 on PA-RISC.

The perl chown command is following links when the last argument is a symbolic link and not a normal file. I'd like to change the ownership of the link itself.

Just for completeness: GNU chown sets the owner:group of the link itself. HP-UX's chown behaves as perl does.

SoPWified - dvergin 2002-05-24

Comment on How do I change the owner:group of a symlink?
Replies are listed 'Best First'.
Re: How do I change the owner:group of a symlink?
by Marza (Vicar) on May 24, 2002 at 19:58 UTC

    Actually you can't in Perl.

    As Tom Christiansen has said(I don't remember where):

    "Perl doesn't do this. Do you know why many systems don't support the idea? Because it conveys no distict functionality. Modes and owners and times on symbolic links have no meaning. So why bother? And it's very non-portable."

    Now as to making a system call. Did you use the "-h" option? I did and it did change the link's ownership without changing the file.

      Oh, bummer. I know it doesn't really matter, but I just need this group of to be owned by bin:bin. Just, uh, because :)

      And you are absolutely right about the -h option. I don't know how I missed it, it's the first option on HP-UX's chown(1) manpage!

      Thanks a bunch,

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://168970]
Approved by mdillon
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2015-10-07 03:37 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (170 votes), past polls