read_char, read_double,
read_float, read_long,
read_short
read_char, read_double,
read_float, read_long,
read_short — read the next character, double, float, long or short value in
binary representation from the input file.
read_char (file)
read_double (file)
read_float (file)
read_long (file)
read_short (file)
fileA file pointer to a previously opened file. This may be either a file in the file system, or a string opened for read and write.
read_char returns the decimal representation of a string of length 1 containing
a single character, or -1 indicating end of file.
read_double,
read_float return a floating point value, or nan
indicating end of file.
read_long,
read_short return an integer value, or -1 indicating end of file.
These functions read the next character, double, float, long or short value in binary representation from the input file, regardless of Lisp expression syntax. This allows a programmer to read binary files constructed by other programs.
The file "myfile.dat" contains the following:
ajz
Successive calls to read_char will produce:
Gamma>ft = open ("myreadcfile.dat","r");#<File:"myreadcfile.dat">Gamma>read_char(ft);97Gamma>read_char(ft);106Gamma>read_char(ft);122Gamma>read_char(ft);-1Gamma>