9.265. TTYNAM

9.265 TTYNAM — Get the name of a terminal device.

Description:
Get the name of a terminal device. For more information, see ttyname(3).

This intrinsic is provided in both subroutine and function forms; however, only one form can be used in any given program unit.

Standard:
GNU extension
Class:
Subroutine, function
Syntax:
CALL TTYNAM(UNIT, NAME)
NAME = TTYNAM(UNIT)
Arguments:
UNIT Shall be a scalar INTEGER.
NAME Shall be of type CHARACTER.
Example:
PROGRAM test_ttynam
  INTEGER :: unit
  DO unit = 1, 10
    IF (isatty(unit=unit)) write(*,*) ttynam(unit)
  END DO
END PROGRAM
See also:
ISATTY

© Free Software Foundation
Licensed under the GNU Free Documentation License, Version 1.3.
https://gcc.gnu.org/onlinedocs/gcc-6.3.0/gfortran/TTYNAM.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部