Description =========== win32-etc - A module that provides Etc functions for the Win32 platform Synopsis ======== require "win32/etc" include Etc puts "Login: " + Etc.getlogin p Etc.getpwnam("Guest") p Etc.getpwuid(512) p Etc.getgrnam("Guests") p Etc.getgrgid(500) Etc.passwd{ |s| p s } Etc.group{ |g| p g } Constants ========= VERSION Returns the current version number, as a String. Class Methods ============= Etc.getlogin Returns the login name of the current user. Etc.getpwnam(user,server=nil) Searches on your local machine for information about 'user'. The return value is a 'Passwd' struct. The Passwd struct contains the following members: * name * uid * comment * usr_comment * full_name * priv * auth_flags * password_age * home_dir * parms * last_logon * last_logoff * bad_pw_count * num_logons * logon_server * country_code * workstations * max_storage * code_page Etc.getpwuid(uid,server=nil) Returns a ((*Passwd*)) entry for the specified 'uid'. Etc.getgrgid(gid,server=nil) Searches your local machine for information about group accounts. The return value is a 'Group' struct. * name * comment * gid * type Etc.getgrname(name,server=nil) Returns a 'Group' entry for the specified 'name'. Etc.group(server=nil){|group_struct|} Iterates over all group entries (yields a 'Group' struct). Etc.passwd(server=nil){|passwd_struct|} Iterates over all user entries (yields a 'Passwd' struct). Known Issues ============ None known. Notes ===== All methods except getlogin() accept a server name as an optional argument. If a server name is provided, lookups are done against that server. Otherwise lookups are done against the local machine. Windows NT users will need to prepend server names with '\\'. I used calls to rb_sys_fail() rather than raising a custom exception because that's what the Unix version does. That decision is not set in stone, so feedback is welcome on the issue. Future Plans ============ Suggestions welcome. License ======= Ruby's Copyright ========= (C) 2003, Daniel J. Berger, All Rights Reserved Author ====== Daniel J. Berger djberg96 at yahoo dot com rubyhacker1 on IRC