Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

finding who owns a file in unix

Status
Not open for further replies.

jimberger

Programmer
Jul 5, 2001
222
GB
Hi all,

Is there a way in perl (like a system call) to return who owns a directory e.g user:group

jim
 
This works on a solaris box, so I am guessing it will
work on all Unix like boxes.

It doesn't seem to work on NT



($ownerid, $groupid) = (stat( "/home/gmccone" ))[4,5];
$ownerName = getpwuid($ownerid);
$groupName = getgrgid($groupid);
print "owner: $ownerName , group: $groupName\n";
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top