[fpc-devel] Publish some of FPC's internal cross-platform functionality

Anton Shepelev anton.txt at gmail.com
Sat Mar 9 21:45:42 CET 2019


Marco van de Voort:

> Really? So why can't you simply use untyped "file"?

I am writing a TextRec driver that shall work with a bare
THandle, e.g.:

Program Test;
uses TextDrv, SysUtils;

var
   t: Text;
   s: AnsiString;
   h: THandle;
begin
   h := FileOpen( 'C:\test.txt', fmOpenRead );
   FdAsText( t, h );
   while not Eof( t ) do
   begin
      ReadLn( t, s );
      WriteLn( s );
   end;
   Close( t );
end.

-- 
Please, do not forward replies to my e-mail.




More information about the fpc-devel mailing list