can I use chown to change a files ownership from root to the user/group like this:
chown("user:psacln","/file/path/to/loc");
I cannot get that to work... I searched for chown and found one, but that shows numbers only, I don't know how to get the username from any number.... in shell I do this:
chown user:psacln /file/to/loc
and that works.

I login to shell via root, so that I can move around on the whole server, so the owner of the files is root, so I need to change them to the username I am logged into, which I put at the top of the config file in var name: $_website_username

I don't know if the script on the page running can change roots files, but hope it can, I will appreciate any feedback you have for this.

thx,
Richard

In reply to using chown to change file ownership by powerhouse

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.