[top][index]
search for:

read File -- read from a file

Synopsis:

  • Usage: s = read f
  • Function: read -- read from a file
  • Input:
  • f, an instance of class File: an input file
  • Output:
  • s, an instance of class String: a string obtained by reading from f.
  • i1 : f = openInOut "!cat"

    o1 = !cat

    o1 : File
    i2 : isReady f

    o2 = false
    i3 : f << "hi there" << flush;
    i4 : isReady f

    o4 = true
    i5 : read f

    o5 = hi there
    i6 : isReady f

    o6 = false

    See also:

  • isReady -- whether a file has data available for reading

  • [top][index]
    search for: