in reply to Re: getpwuid issue
in thread getpwuid issue

The code is fairly simple - given a file - $basename
if (-e $basename) { $attrs = stat($basename); my $fileOwnerID = $attrs->uid; $fileOwner = (getpwuid $fileOwnerID)[0]; #$fileOwner = sprintf "%s",stat($basename)->uid; my $groupID = $attrs->gid; $groupName = (getgrgid $groupID)[0]; }
So if getpwuid is not implemented or cannot be used in Windows...how do I get the name of the owner of a file ?

Replies are listed 'Best First'.
Re^3: getpwuid issue
by marto (Cardinal) on Dec 02, 2011 at 17:57 UTC

    "The code is fairly simple"

    In future, as described in How do I post a question effectively? consider posting a minimal example which demonstrates the problem in your first post, rather than people having to draw information from you piece meal. I suggest you actually google search getptuid to find out what it is, and why it doesn't work on your platform.