diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-23 05:07:38 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-23 05:07:38 +0000 |
commit | 9e67f6ecec169787bb489ccb3f71d32a141f01da (patch) | |
tree | a4953094ab4bd3abd815a6946e076177e272dac5 /doc | |
parent | 400afca88a0adb5a380925dea61220e08a04022f (diff) | |
download | ruby-9e67f6ecec169787bb489ccb3f71d32a141f01da.tar.gz |
* doc/etc.rd, doc/etc.rd.ja: moved from ext/etc.
* ext/etc.c (Init_etc): fixed rdoc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'doc')
-rw-r--r-- | doc/etc.rd | 75 | ||||
-rw-r--r-- | doc/etc.rd.ja | 75 |
2 files changed, 150 insertions, 0 deletions
diff --git a/doc/etc.rd b/doc/etc.rd new file mode 100644 index 0000000000..b69f9884ad --- /dev/null +++ b/doc/etc.rd @@ -0,0 +1,75 @@ +# etc.rd - -*- mode: rd; coding: us-ascii -*- created at: Fri Jul 14 00:47:15 JST 1995 +=begin + += Etc(Module) + +The module to retrieve information from running OS. All operations +defined in this module are module functions, so that you can include +Etc module into your class. + +== Module Function + +--- getlogin + + returns login name of the user. It this fails, try getpwuid(). + +--- 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. + +--- getpwuid([uid]) + + returns passwd entry for the specified user id. If uid is + ommitted, use the value from getuid(). See getpwuid(3) for + detail. + +--- 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. + +--- getgrnam(name) + + returns the group entry for the specified name. The return + value is the group structure. See getgrnam(3) for detail. + +--- group + + iterates over all group entries. + +--- passwd + + iterates over all passwd entries. + +=end diff --git a/doc/etc.rd.ja b/doc/etc.rd.ja new file mode 100644 index 0000000000..39a1efbff1 --- /dev/null +++ b/doc/etc.rd.ja @@ -0,0 +1,75 @@ +# etc.rd.ja - -*- mode: rd; coding: euc-jp; -*- created at: Fri Jul 14 00:47:15 JST 1995 +=begin + += Etc(モジュール) + +実行しているOSからの情報を得るためのモジュール.クラスにインクルード +して使うこともできる. + +== Module Function + +--- getlogin + + 自分のlogin名を返す.これが失敗した場合はgetpwuid()を用いると + 良い. + +--- 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)を参照のこと. + +--- getpwuid([uid]) + + uidをユーザIDとするpasswdエントリを返す.戻り値はgetpwnam()と + 同様である.引数を省略した場合にはgetuid()の値を用いる.詳細は + getpwuid(3)を参照のこと. + +--- getgrgid(gid) + + /etc/groupファイル(あるいは…getpwnam参照)を検索し,gidをグルー + プIDとするグループエントリを返す.戻り値はgroup構造体で以下の + メンバを持つ. + + struct group + name # グループ名(文字列) + passwd # グループのパスワード(文字列) + gid # グループID(整数) + mem # グループメンバ名の配列 + end + + 詳細はgetgrgid(3)を参照のこと. + +--- getgrnam(name) + + nameという名前のグループエントリを返す.戻り値はgetgrgid()と同 + 様である.詳細はgetgrnam(3)を参照. + +--- group + + 全てのグループエントリを順にアクセスするためのイテレータ. + +--- passwd + + 全てのpasswdエントリを順にアクセスするためのイテレータ. + +=end |