stream: STREAM_TYPE_FILE will now read file upfront

No more having to chunk read - if ~stream_init_file~ is used, the
constructor slurps the entire file into the cache.  This pays up front
for a bunch of checks essentially.

~stream_init_pipe~ should be used for chunked reading.
This commit is contained in:
2026-02-09 08:10:44 +00:00
committed by oreodave
parent 6a54c54bfb
commit f56a59ff7a
3 changed files with 24 additions and 16 deletions

View File

@@ -113,9 +113,8 @@ void stream_test_file(void)
TEST(err == STREAM_ERR_OK, "Expected initialisating to be okay: %s",
stream_err_to_cstr(err));
}
TEST(stream_size(&stream) == 0, "Stream doesn't read on init: size = %lu",
stream_size(&stream));
TEST(!stream_eoc(&stream), "Stream should not be at the EoC from init.");
stream_stop(&stream);
}
// try to initialise the stream again but against a nonexistent file - we're