Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

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?
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,
      -Dan

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (9)
As of 2014-12-19 12:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (82 votes), past polls