関数 isatty は、論理装置 lunit が端末装置かどうかによって、true または false を返します。
関数は、次のように呼び出します。
|
terminal = isatty( lunit ) |
|||
|
lunit |
INTEGER*4 |
入力 |
論理装置 |
|
戻り値 |
LOGICAL*4 |
出力 |
terminal = 真: 端末デバイスである terminal = 偽: 端末デバイスではない |
例: lunit が tty であるかどうかを確認します。
character*12 name, ttynam
INTEGER*4 lunit /5/
logical*4 isatty, terminal
terminal = isatty( lunit )
name = ttynam( lunit )
write(*,*) '端末 = ', terminal, ', 名前 = "', name, '"'
end
|
出力は次のように表示されます。
端末 = T, 名前 = "/dev/ttyp1 " |