From: Koji Arai Date: 2000-08-23T19:20:35+09:00 Subject: [ruby-list:24398] Re: Ruby Documentation Project(仮) ----Next_Part(Wed_Aug_23_19:15:57_2000_809)-- Content-Type: Text/Plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit 新井です。 From: rubikitch Date: 23 Aug 2000 14:12:55 +0900 Subject: [ruby-list:24391] Ruby Documentation Project(仮) > るびきちです。 > > > こういうの適当な場所(たとえば俺んとこ)に集めておきたいな。 > とりあえず、ここにでっちあげておきました。 > http://www.oishi.info.waseda.ac.jp/~takashi/rubikitch/RDP.html ついでにRAA登録ってのはどうです? 意外に(ドキュメントも含めて)存在が知られていない Etc モジュー ルのドキュメントをRD化しました。 ----Next_Part(Wed_Aug_23_19:15:57_2000_809)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="etc.rd" =begin == Etc The module to retrieve information under (({/etc})) directory. Available only on UNIX platforms. All operations defined in this module are module functions, so that you can include Etc module into your class. == Usage: (({ })) require "etc.so" p Etc.getlogin == Module Function: --- Etc.getlogin returns login name of the user. It this fails, try (()). --- Etc.getpwnam(name) searches in (({/etc/passwd})) file (or equivalent database), and returns password entry for the user. The return value is an passwd structure, which has members described below. struct passwd name # user name(string) passwd # encrypted password(string) uid # user ID(integer) gid # group ID(integer) gecos # gecos field(string) dir # home directory(string) shell # login shell(string) # members below are optional change # password change time(integer) quota # quota value(integer) age # password age(integer) class # user access class(string) comment # comment(string) expire # account expiration time(integer) end See (({getpwnam(3)})) for detail. --- Etc.getpwuid([uid]) returns passwd entry for the specified user id. If uid is ommitted, use the value from (({getuid(2)})). See (({getpwuid(3)})) for detail. --- Etc.getgrgid(gid) searches in (({/etc/group})) file (or equivalent database), and returns group entry for the group id. The return value is an group structure, which has members described below. struct group name # group name(string) passwd # group password(string) gid # group ID(integer) mem # array of the group member names end See (({getgrgid(3)})) for detail. --- Etc.getgrnam(name) returns the group entry for the specified name. The return value is the group structure. See (({getgrnam(3)})) for detail. --- Etc.group iterates over all group entries. --- Etc.passwd iterates over all passwd entries. =end ----Next_Part(Wed_Aug_23_19:15:57_2000_809)-- Content-Type: Text/Plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="etc-ja.rd" =begin = Etc (({/etc}))ディレクトリ以下の情報を得るためのモジュール.クラスにインクルード して使うこともできる. == 使い方: (({ })) require "etc.so" p Etc.getlogin == モジュール関数: --- Etc.getlogin 自分のlogin名を返す.これが失敗した場合は(())を用いると 良い. --- Etc.getpwnam(name) (({/etc/passwd}))ファイル(あるいはDBMファイルやNISデータベース)を検 索し,((|name|))の名前を持つpasswdエントリを返す.戻り値はpasswd構造 体で以下のメンバを持つ. struct passwd name # ユーザ名(文字列) passwd # パスワード(文字列) uid # ユーザID(整数) gid # グループID(整数) gecos # gecosフィールド(文字列) dir # ホームディレクトリ(文字列) shell # ログインシェル(文字列) # 以降のメンバはシステムによっては提供されない. change # パスワード変更時間(整数) quota # クォータ(整数) age # エージ(整数) class # ユーザアクセスクラス(文字列) comment # コメント(文字列) expire # アカウント有効期限(整数) end 詳細は(({getpwnam(3)}))を参照のこと. --- Etc.getpwuid([uid]) ((|uid|))をユーザIDとするpasswdエントリを返す.戻り値は (())と同様である.引数を省略した場合には (({getuid(2)}))の値を用いる.詳細は(({getpwuid(3)}))を参照のこと. --- Etc.getgrgid(gid) (({/etc/group}))ファイル(あるいは…(())参照)を検索し, ((|gid|))をグループIDとするグループエントリを返す.戻り値はgroup構 造体で以下のメンバを持つ. struct group name # グループ名(文字列) passwd # グループのパスワード(文字列) gid # グループID(整数) mem # グループメンバ名の配列 end 詳細は(({getgrgid(3)}))を参照のこと. --- Etc.getgrnam(name) ((|name|))という名前のグループエントリを返す.戻り値は (())と同様である.詳細は(({getgrnam(3)}))を参照. --- Etc.group 全てのグループエントリを順にアクセスするためのイテレータ. --- Etc.passwd 全てのpasswdエントリを順にアクセスするためのイテレータ. =end ----Next_Part(Wed_Aug_23_19:15:57_2000_809)----