Thread: statBuf.st_uid -> username?

  1. #1
    Registered User samGwilliam's Avatar
    Join Date
    Feb 2002
    Location
    Newport
    Posts
    382

    statBuf.st_uid -> username?

    How do I get the user's name from their user id number?

  2. #2
    Registered User rohit's Avatar
    Join Date
    Feb 2002
    Posts
    69
    #include <pwd.h>
    struct passwd * getpwuid(int uid)

    struct passwd is
    {char* pw_name;
    char * pw_passwd;
    .... bla bla
    };see man getpwuid

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. small -> big -> bigger -> bigger than bigger -> ?
    By happyclown in forum A Brief History of Cprogramming.com
    Replies: 9
    Last Post: 03-11-2009, 12:12 PM
  2. Dev-C++ -> Tools - > Editor -> Syntax
    By Yuri2 in forum C++ Programming
    Replies: 19
    Last Post: 07-03-2006, 07:48 AM
  3. > > > Urgent Help < < <
    By CodeCypher in forum C Programming
    Replies: 2
    Last Post: 01-31-2006, 02:06 PM
  4. username collection
    By algi in forum C++ Programming
    Replies: 3
    Last Post: 01-22-2005, 02:20 PM