read

read f -- yields a string obtained by reading bytes from the input file f .
read () -- reads from stdin, getting input from the user.
read s -- reads from stdin, getting input from the user, prompting with the string s.

Input files are buffered, so the current contents of the buffer are returned if the buffer is not empty, otherwise reading from the file is attempted first.

See also get and File.

Go to main index.

Go to concepts index.