Zig NEWS

Discussion on: Want to create a TUI application? - The Basics of "Uncooked" Terminal IO

Collapse
 
jpl profile image
Jean-Pierre

Thank you

Just a remark
I tested with 0.10.0 or 0.11.0 dev 945
I have a problem with
tty = try fs.cwd().openFile("/dev/tty", .{ .read = true, .write = true });
and I returned:
tty = fs.cwd().openFile("/dev/tty", .{ .mode = .read_write}) catch unreachable;

i work with linux

Thread Thread
 
edgareatspi profile image
Edgar

I agree! For some reason, this program outright doesn't work at all on my machine. Was this article based on some older version of Zig? (I use Zig 0.14)

Thread Thread
 
jpl profile image
Jean-Pierre

exemple: ok for 0.13.0 or 0.14. dev

    const cDIR = std.fs.cwd().openDir("dspf",.{})
    catch |err| {@panic(try std.fmt.allocPrint(allocator,"err Open DIR.{any}\n", .{err}));};

    var fjson = cDIR.openFile(nameJson, .{.mode = .read_write}) catch |err| {
                @panic(try std.fmt.allocPrint(allocator,"err Open FILE.{any}\n", .{err}));};
    defer fjson.close();

Enter fullscreen mode Exit fullscreen mode