opens a file for reading
INCLUDE 'iolib.h' openread(file,"filename")
openread(Handle,FileName) (i,i) (o,i)
handle(Handle) (i) virtual file handled which will be associated with the
void(Handle) (o) real file handle returned by the host
string(FileName) (i) name of the file to be opened
The file with the name FileName is opened for reading only. It is referred to by the Handle, which may either be virtual or real.
file_str("test","Hello World"), openread(f,"test"), readdevice(f), readln(X), readdevice(keyboard), closefile(f), write(X),nl.
No runtime errors. Fails if file could not be opened.
prolog-process, client-server, object
closefile , openmodify , openwrite , readdevice , writedevice , read , write