getpwuid
getpwuid UID
指定したユーザIDに対する以下の情報を返します。スカラーコンテキストではユーザ名を返します。
WindowsXP + Active Perlでは使えませんでした。
| 1 | ユーザ名 |
| 2 | ユーザのパスワード |
| 3 | ユーザID |
| 4 | グループID |
| 5 | quota |
| 6 | コメント |
| 7 | 本名 |
| 8 | ホームディレクトリ |
| 9 | シェルプログラム |
サンプルプログラム
use strict; use warnings; my ($name, $password, $uid, $gid, $quota, $comment, $gcos, $dir, $shell) = getpwuid 501; printf "%s,%s,%s,%s,%s,%s,%s,%s,%s\n", $name, $password, $uid, $gid, $quota, $comment, $gcos, $dir, $shell;
関連項目
・ファイル所有者の取得・ログイン名の取得
・getgrgid関数
・getlogin関数
・getpwent関数
・getpwnam関数
