Dec 14, 2001 #1 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
Hi all, Is there a way in perl (like a system call) to return who owns a directory e.g user:group jim
Dec 14, 2001 #2 gkmccone Technical User Oct 24, 2001 17 US 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"; Upvote 0 Downvote
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";