Darwin Help

Back to Index

OpenReading

Function OpenReading - open a file for future reading

Calling Sequence  OpenReading(filename)
Parameters
NameTypeDescription

filename string 
Return Type  NULL
Synopsis This functions opens the file given as argument for reading. Any future ReadRawLine or ReadLine commands will read data from the opened file. When the end of the file is reached, the read commands will return the token EOF. If the argument is the name 'terminal', then the standard input (stdin in Unix) is opened for input. A file that is opened this way can contain Darwin commands or any arbitrary text. If a ReadRawLine() command is used, then a textual line of the file will be read. If a ReadLine() command is used, then the line is expected to be a valid Darwin command. If filename ends in ".gz" or ".Z", then it is assumed to be a compressed file and it is decompressed before reading.
Examples
> OpenReading( '/home/darwin/test' );

> t := ReadRawLine();

> OpenReading(terminal);

See also FileStat,   inputoutput,   MySql,   OpenAppending,   OpenPipe,   OpenWriting,   ReadData,   ReadLine,   ReadOffsetLine,   ReadRawFile,   ReadRawLine,   ReadURL