# \[ANN\] sys-admin 1.0.0

**URL:** <https://rubytalk.org/t/ann-sys-admin-1-0-0/17175>\
**Category:** ruby-talk\
**Created:** [25 March 2005 20:56 UTC](https://rubytalk.org/t/ann-sys-admin-1-0-0/17175 "2005-03-25T20:56:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Berger\_Daniel1](https://avatars.discourse-cdn.com/v4/letter/b/ecc23a/32.png) [@Berger\_Daniel1](https://rubytalk.org/u/Berger_Daniel1)\
**Post date:** [25 March 2005 20:56 UTC](https://rubytalk.org/t/ann-sys-admin-1-0-0/17175/1 "2005-03-25T20:56:05Z")

</div>

Hi all,

I am happy to annouce the first release of the sys-admin package.

What is it?

> **···**
>
> ===========  
> The sys-admin package is meant to be a unified (as in API),  
> cross-platform replacement for the Etc module.
> 
> # Synopsis
> 
> require "sys/admin"  
> include Sys
> 
> # Get the current login  
> p Admin.get\_login
> 
> # Yields a User object for each user  
> Admin.users{ |user|  
> &nbsp;&nbsp;&nbsp;p user  
> }
> 
> # Returns an Array of User objects  
> a = Admin.users
> 
> # Yields a Group object for each group  
> Admin.groups{ |group|  
> &nbsp;&nbsp;&nbsp;p group  
> }
> 
> # Returns an Array of Group objects  
> g = Admin.groups
> 
> # Get information about a particular user  
> p Admin.get\_user("nobody")
> 
> # Get information about a particular group  
> p Admin.get\_group("adm")
> 
> # What's missing?
> 
> You cannot add, configure or delete users in this release. This will be  
> added in the next release.
> 
> # Where can I get it?
> 
> You can find "sys-admin" listed on the RAA.
> 
> # Preemptive FAQ
> 
> Q) Did we really need a replacement for the Etc module?  
> A) Yes. The Etc module has two problems. First, and foremost, it  
> doesn't work on Windows. Second, the name doesn't make any sense when  
> you take Windows into account and, IMHO, the API was far too literal a  
> translation of the header functions from pwd.h and grp.h. The fact that  
> it doesn't work on Windows has lead to other issues, like the fact that  
> File.stat returns bogus info for some Stat members.
> 
> Q) What about win32-etc?  
> A) The win32-etc package is officially deprecated as of today  
> (25-Mar-2005), but will still be available for download until I add the  
> ability to add, configure and delete users. At that point, it will be  
> removed from the Win32 Utils project.
> 
> Q) But didn't win32-etc already solve all these problems?  
> A) To a point, yes. However, my ultimate goal is to (hopefully) have  
> the sys-admin package added to the core Ruby distro and used in place of  
> the Etc module so that we can eliminate some of the other core issues  
> (e.g. File.stat). Also, I changed my mind slightly regarding the  
> USER\_INFO struct that I decided to use in the Win32 code. Finally, you  
> still had the issue of the name "Etc" and the function names which,  
> while they may have been familiar to \*nix users, made no sense on the  
> Win32 platform.
> 
> Q) But is the API truly identical?  
> A) The method names are identical. The only difference is that all of  
> the methods (except Admin.get\_login) allow you to pass a machine name as  
> an optional argument, so you can retrieve user and group information  
> from other machines, assuming you're on a network. In addition, because  
> Windows has the concept of local versus global groups, you can pass an  
> optional second argument to the Admin.get\_group and Admin.groups methods  
> to indicate which group type you're after.
> 
> See the documentation for more details.
> 
> Q) What's up with the block vs non-block syntax?  
> A) I provided non-block forms for speed and ease of marshalling.
> 
> Q) Hey! Where's the gem?  
> A) I couldn't get it to work because of the way I prefer to separate my  
> source files. There's a (broken) gemspec in CVS. I need some help  
> there. But, the source code, README and CHANGES files are all rdoc  
> friendly. You'll just have to install the old fashioned way in the  
> meantime (i.e. ruby extconf.rb; make; make site-install).
> 
> Enjoy!
> 
> Dan
