lass="binding-type">cfunction</span> <span class="binding-type"><a href="https://github.com/janet-lang/janet/blob/73334f3/src/core/io.c#L211">source</a></span> <pre class="binding-text">(file/read f what &amp;opt buf)

Read a number of bytes from a file `f` into a buffer. A buffer `buf` can be provided as an optional third argument, otherwise a new buffer is created. `what` can either be an integer or a keyword. Returns the buffer with file contents. Values for `what`:

* :all - read the whole file

* :line