try
blockread(AnsiFile, buffer[1], FileSize(AnsiFile));
That fixed the error reading. Now I get an error saying file not opened.When? when you try to print the buffer on screen? before that? You do know that you call close(AnsiFile); and then you try filesize(ansifile) how about changing the code to
NO its an ANSI file
[…]InOutRes is reset by the system unit (https://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/rtl/linux/system.pp?revision=36695&view=markup#l452), so not doing that on your own isn't necessarily wrong.
before doing any pascal IO, first do this
InOutRes := 0;
[…]
NO its an ANSI file
What do you mean by that?
I ask, since you seem to want to load the contents in a String.
Bart