File descriptor of input
uses linux;
Function GetFS(Var F:Any File Type):Longint;
Например:
Uses linux;
begin
Writeln (' File descriptor of input ',getfs(input));
Writeln ('File descriptor of output ',getfs(output));
Writeln ('File descriptor of stderr ',getfs(stderr));
end.
Пример использования SelectText:
Uses linux;
Var tv : TimeVal;
begin
Writeln ('Press the <ENTER> to continue the program.');
{ Wait until File descriptor 0 (=Input) changes }
SelectText (Input,nil);
{ Get rid of <ENTER> in buffer }
readln;
Writeln ('Press <ENTER> key in less than 2 seconds...');
tv.sec:=2;
tv.usec:=0;
if SelectText (Input,@tv)>0 then
Writeln ('Thank you !')
else
Writeln ('Too late !');
end.
Содержание Назад Вперед