fix(examples): 0712 sha256 streaming writes scratch to .sx-tmp not /tmp [FINAL-rem F2]

Scratch file path violated the project rule 'scratch files go in
.sx-tmp/, never /tmp'. Route the temp .bin through the repo-local,
gitignored .sx-tmp/ dir, creating it at runtime via create_dir_all
(mirroring 0713) so the test is self-contained on a clean checkout.
Digest assertions and output are unchanged.
This commit is contained in:
agra
2026-06-05 21:18:08 +03:00
parent 60e5939fdf
commit 035ef6c613

View File

@@ -59,7 +59,8 @@ main :: () {
check("split-on-boundary", stream_split(MSG, 64), PIN); // 64: exact block edge
// sha256_file (streaming) must equal the in-memory digest.
path := "/tmp/sx_0712_stream.bin";
if !create_dir_all(".sx-tmp") { print("mkdir: FAIL\n"); return; }
path := ".sx-tmp/sx_0712_stream.bin";
if !write_file(path, MSG) { print("file-write: FAIL\n"); return; }
maybe := sha256_file(path);