From: "Mark J. Reed" Date: 2004-02-02T11:19:49+09:00 Subject: Re: ruby way to enumerate users MJR> require 'etc' MJR> class Users MJR> include Etc MJR> include Enumerable MJR> def each MJR> setpwent MJR> while pw = getpwent MJR> yield pw MJR> end MJR> endpwent MJR> end MJR> end MJR> Users.new.each { |u| puts u.name } ES> Simpler: ES> ES> require 'etc' ES> class Users ES> include Etc ES> include Enumerable ES> alias :each :passwd ES> public :each ES> end Simpler, but not equivalent. That version starts wherever the last call to getpwent passwd left off, instead of starting over at the first entry. -Mark