Io.File.WriteStreaming Help

hello,

.zig/lib/std/Io/File.zig:225:16: error: no field or member function named 'fileWriteStreaming' in 'Io.File'
    return file.fileWriteStreaming(io, buffer);

if use :

const byte: []const u8 = std.fmt.allocPrint(allocTest,"{s}", .{"hello"}) catch unreachable;

var hello = [1][]const u8 {byte};

_ = std.Io.File.writeStreaming(filePhy,io,&hello) catch unreachable; 

It is unclear what you are trying to do.
What do you want to do?

Do you want to write to a file?

const std = @import("std");
const Io = std.Io;

pub fn main() !void {
    // NOTE truncate needs to be false if you want to append
    const example = try std.fs.cwd().createFile("example.txt", .{ .truncate = false });
    defer example.close();

    var buffer: [512]u8 = undefined;
    var writer = example.writer(&buffer);
    try writer.seekTo(try writer.file.getEndPos()); // NOTE set position to end (if you want to append)

    const out: *Io.Writer = &writer.interface;

    try out.print("hello\n", .{});
    // or
    try out.writeAll("hello\n");

    try out.flush();
}

Yes, that was the case in 15.2,
but not in 16.0.dev.

try std.fs.cwd().createFile

deprecated

Writing for Io.File is not implemented yet. std.Io.File and std.Io.Dir are very incomplete at the moment.

1 Like

I’ve been racking my brains over this.
Very serious…
Glad to have it confirmed.

omg this has been messing with my brain the last 15min

thank you