getpwuid

should I free pointer returned by getpwuid() in Linux?

Hi, After I call getpwuid(uid), I have a reference to a pointer. Should I free that when I don't use it anymore? Reading the man pages, it says that it makes reference to some static area, that may be overwritten by subsequent calls to the same functions, so I'm sure sure if I should touch that memory area. Thanks. ...

How do I get user and group information in Perl on Windows?

Perl has several built-in functions for accessing /etc/passwd on Unix systems (and elsewhere when supported) for user and group information. For instance, my $name = getpwuid($uid); will return the user name given the user ID, or undef if there is no such user. If a Perl script needs to be portable and run on Unices and Windows, how ...

list of uids / names of System Preferences > Accounts

How can I obtain an array with uid and names? I could iterate from 0 to 99999 and do a getpwnam(). However most machines have less than 5 accounts, so it's not optimal. I don't know what framework is responsible for this and thus I have no clue what to search for. Is there a more optimal solution that can traverse the accounts? Edit:...