posix_ttyname

(PHP 4, PHP 5, PHP 7)

posix_ttynameDetermine terminal device name

Descrierea

posix_ttyname ( resource|int $file_descriptor ) : string|false

Returns a string for the absolute path to the current terminal device that is open on the file descriptor file_descriptor.

Parametri

fd

Descriptorul fișierului, care trebuie să fie o resource de fișier, sau un integer. Un integer se va presupune a fi un descriptor de fișier care poate fi transmis direct către apelul de sistem ce stă la bază.

În majoritatea cazurilor veți dori să utilizați o resource de fișier.

Valorile întoarse

On success, returns a string of the absolute path of the file_descriptor. On failure, returns false

add a note add a note

User Contributed Notes 1 note

up
0
casper at bcx dot nl
17 years ago
<?php
    var_dump
( posix_ttyname(STDOUT) );
?>

returns:
string(10) "/dev/pts/0"

When using pseudo terminal 1 (ie ssh)
To Top