S
S
semki0962016-04-29 09:55:23
linux
semki096, 2016-04-29 09:55:23

Who is the owner of the file, and how is the uid determined?

Created a test file on the server and displayed its data on the screen

$stat = stat($path);
print_r(posix_getpwuid($stat['uid']));

And here is the data itself
Array ( [name] => r33333 [passwd] => x [uid] => 1717 [gid] => 1715 [gecos] => [dir] => /home/r33333 [shell] => /usr/local/cpanel/bin/noshell )

Question - where did [uid] => 1717 and [gid] => 1715 come from - what is it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Ukolov, 2016-04-29
@semki096

nameThe name element contains the user's name. This is a short, usually less than 16 character "handle" for the user, and is not the actual full name of the user.
idNumeric user ID, must match the uid parameter passed when calling the function. Is redundant.
guideThe user's group ID. Use the posix_getgrgid() function to get the name of a group and a list of its member users.

What do you not understand from the documentation ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question