Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

HELP HOW TO: chown

codecraigcodecraig Member Posts: 163
How exactly can I do a chown on a folder or file? Currently there is no owner for either.

would it be like this?
[code]
$tmp = chown("MyProgramFolder/SomeProgram.exe", username);

If $tmp
print("Success");
Else
print("Fail");
[/code]

Because that did not work for me when the folder & file had no current owner associated with them.

Please let me know.
Thanks
Craig


Comments

  • fnoyanfnoyan Member Posts: 103
    : How exactly can I do a chown on a folder or file? Currently there is no owner for either.
    :
    : would it be like this?
    : [code]
    : $tmp = chown("MyProgramFolder/SomeProgram.exe", username);
    :
    : If $tmp
    : print("Success");
    : Else
    : print("Fail");
    : [/code]
    :
    : Because that did not work for me when the folder & file had no current owner associated with them.
    :
    : Please let me know.
    : Thanks
    : Craig
    :

    Hi.
    if there is no current user (the user does not exist). use inval($uname)
    . see php.net function referance chown.

  • codecraigcodecraig Member Posts: 163
    : : How exactly can I do a chown on a folder or file? Currently there is no owner for either.
    : :
    : : would it be like this?
    : : [code]
    : : $tmp = chown("MyProgramFolder/SomeProgram.exe", username);
    : :
    : : If $tmp
    : : print("Success");
    : : Else
    : : print("Fail");
    : : [/code]
    : :
    : : Because that did not work for me when the folder & file had no current owner associated with them.
    : :
    : : Please let me know.
    : : Thanks
    : : Craig
    : :
    :
    : Hi.
    : if there is no current user (the user does not exist). use inval($uname)
    : . see php.net function referance chown.
    :
    :

    I checked php.net for the chown function, and I understand how to use it, maybe the problem is the username...i'll look it to that.
    What is the "inval($uname)" you mentioned above? did you mean [code]intval[/code] ???

    thx
    craig
  • fnoyanfnoyan Member Posts: 103
    I checked php.net for the chown function, and I understand how to use it, maybe the problem is the username...i'll look it to that.
    : What is the "inval($uname)" you mentioned above? did you mean [code]intval[/code] ???
    :
    : thx
    : craig
    :
    hmmm,I am confused :/
    I just send you the a user's comment form php.net
    --------------------------------------------------------------
    martijn at sigterm dot nl
    20-Jun-2003 02:28
    If chown is filled with a variable ( chown ("myfile", $uid) the uid will be looked up through pwget_uid.

    So if you need to set a non existing uid use inval($uid).
    ----------------------------------------------------------------

    intval returns the integer value, so I don't think it is the function you are looking for.
    So, why do you want to work with a non-existing user?


Sign In or Register to comment.