User Info

This is a discussion on User Info within the Linux Programming forums, part of the Platform Specific Boards category; Hi All,
Just wondering if anyone could reccomend a way of getting user account into (name, homedir and any plan ...

User Info

Hi All,
Just wondering if anyone could reccomend a way of getting user account into (name, homedir and any plan they may have) in C from a username. kinda like finger I guess. I thought of verifying a users homedir but that's not an option as users without a homedir would be excluded. The info would then be passed onto a series of GTK labels, but i'll worry about that later

Ok, I've been trying to find out some info on using getpwent for a good few hours now and have found nothing, would someone be kind enough to shove me in the right directtion with a link? - There seems to be little of use in the man pages

The ! is there because it will return -1 if the first one is "bigger", 0 if they're equal and 1 if the second one is "bigger". I can't remember what is the comparison it does right now, but you're looking for it to return a 0.
EDIT: Fixed a typo.
Also, with the if statement you had, it was comparing one pointer to another, and they'll never be equal in this function.

fj

you do not need to put yourself through all that bull$$$$ just use echo and the $user but that is only if you are logged on to that account so you might have to put yourself through all that bull$$$$ and also the most common working directory is /home/user just to let you know hope that helped

Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie