# Back to Basics: File Reading with the New IO in Zig

**URL:** <https://ziggit.dev/t/back-to-basics-file-reading-with-the-new-io-in-zig/12180>\
**Category:** Media\
**Tags:** standard-library\
**Created:** [September 24, 2025, 1:08am UTC](https://ziggit.dev/t/back-to-basics-file-reading-with-the-new-io-in-zig/12180 "2025-09-24T01:08:29Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![jmctagger](https://ziggit.dev/letter_avatar_proxy/v4/letter/j/8dc957/32.png) [@jmctagger](https://ziggit.dev/u/jmctagger)\
**Post date:** [December 4, 2025, 6:16pm UTC](https://ziggit.dev/t/back-to-basics-file-reading-with-the-new-io-in-zig/12180/11 "2025-12-04T18:16:33Z")

</div>

Funny that this should resurface today.

Earlier, [stratts advocated](https://ziggit.dev/t/struggling-to-simply-read-from-a-file/13337/15) for _not_ assigning the interface to a variable at all.

Indeed, in this case, in [your post](https://williamw520.github.io/2025/09/23/back-to-basic-reading-file-in-zig.html):

```zig
    var file_reader: std.fs.File.Reader = file.reader(&read_buf);

    // Pointer to the std.Io.Reader interface to use the generic IO functions.
    const reader = &file_reader.interface;

```

You create a reader just as in the discussion (and oops) of that thread. I notice that file\_reader is used for nothing other than its interface, and that the interface (`reader`) is used only twice. Obviously, in a real app, it would potentially be used much more, and `file_reader` might, too, but would it make sense to propagate @stratts proposal, and just

```zig
    _ = file_reader.interface.streamDelimiter(&line...

```

instead, and possibly rename variables for ergonomics?

---

_[View the full topic](https://ziggit.dev/t/back-to-basics-file-reading-with-the-new-io-in-zig/12180)._
