<?xml version="1.0" encoding="utf-8" ?> <!-- for emacs: -*- coding: utf-8 -*- --> <!-- Apache may like this line in the file .htaccess: AddCharset utf-8 .html --> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd" > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head><title>read(File,ZZ) -- read from a file</title> <link rel="stylesheet" type="text/css" href="../../../../Macaulay2/Style/doc.css"/> </head> <body> <table class="buttons"> <tr> <td><div><a href="_read_lp__Sequence_rp.html">next</a> | <a href="_read_lp__File_rp.html">previous</a> | <a href="_read_lp__Sequence_rp.html">forward</a> | <a href="_read_lp__File_rp.html">backward</a> | up | <a href="index.html">top</a> | <a href="master.html">index</a> | <a href="toc.html">toc</a> | <a href="http://www.math.uiuc.edu/Macaulay2/">Macaulay2 web site</a></div> </td> </tr> </table> <hr/> <div><h1>read(File,ZZ) -- read from a file</h1> <div class="single"><h2>Synopsis</h2> <ul><li><div class="list"><dl class="element"><dt class="heading">Usage: </dt><dd class="value"><div><tt>read(f,n)</tt></div> </dd></dl> </div> </li> <li><span>Function: <a href="_read.html" title="read from a file">read</a></span></li> <li><div class="single">Inputs:<ul><li><span><tt>f</tt>, <span>a <a href="___File.html">file</a></span>, a file</span></li> <li><span><tt>n</tt>, <span>an <a href="___Z__Z.html">integer</a></span>, an integer specifying the maximum number of bytes to read</span></li> </ul> </div> </li> <li><div class="single">Outputs:<ul><li><span><span>a <a href="___String.html">string</a></span>, a string obtained by reading from <tt>f</tt></span></li> </ul> </div> </li> </ul> </div> <div class="single"><h2>Description</h2> <div>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.</div> </div> <div class="single"><h2>See also</h2> <ul><li><span><a href="_open__In_lp__String_rp.html" title="open an output file">openIn</a> -- open an output file</span></li> <li><span><a href="_get.html" title="get the contents of a file">get</a> -- get the contents of a file</span></li> <li><span><a href="_is__Ready_lp__File_rp.html" title="whether a file has data available for reading">isReady</a> -- whether a file has data available for reading</span></li> </ul> </div> </div> </body> </html>