<?php
var_dump( posix_ttyname(STDOUT) );
?>
returns:
string(10) "/dev/pts/0"
When using pseudo terminal 1 (ie ssh)
posix_ttyname
(PHP 4, PHP 5)
posix_ttyname — 端末のデバイス名を調べる
説明
string posix_ttyname
( int $fd
)
ファイル記述子 fd 上でオープンしている現在の端末デバイスへの絶対パスを文字列で返します。
パラメータ
- fd
-
ファイル記述子。
返り値
成功した場合に fd の絶対パスを表す文字列、 失敗した場合に FALSE を返します。
posix_ttyname
casper at bcx dot nl
19-Apr-2006 11:10
19-Apr-2006 11:10