in reply to Re: ~username expansionin thread ~username expansion
It's better to use getpwnam rather than reading the password file by hand (for example if the machine uses NIS / YP and you're not on the master machine you'll miss accounts).