View Single Post
  #1  
Old 09-16-2018, 03:54 PM
oxygen oxygen is offline
Junior Member
 
Join Date: May 2018
Posts: 8
Question How to get file size to fileread?

I'm diving in this stuff about two hours but cannot find how to get the size of file to be opened by fileread:


Code:
FileHandle : Integer;
fSize: Integer;
begin
      FileHandle := FileOpen('b:\html.txt', fmOpenRead);
      fSize := fileSize(FileHandle);
      FileRead(FileHandle, buffer , fSize );
end;
I need to read the complete file and FileRead seems to be best suitable for me.

I would like to avoid the fileSize function because it has different type then the FileRead input argument no 3.
Reply With Quote