I did nothing special: just wrote, compiled and run that program. And yeah, unsurprisingly that looks like the ReadFileToString in my installation, file:
/usr/share/lazarus/2.0.6/components/lazutils/fileutil.inc
Note that the point you're raising applies mostly to "files" which are dinamically (and continuosly) updated; mostly static seudo- and real files are readable as ... well, normal files. At least that has been my experience (and it's a rather long one).