≈ the.bay.news

How to Open a folder or file and if it doesn't exists create the folder/file

Ziggit
How to Open a folder or file and if it doesn't exists create the folder/file
So I’m working on a program that needs to open a folder and if the folder doesn’t exists it creates it, but I’m stuck as it is. this is my code. pub fn setProjectHome(io: std.Io, env: *std.process.Environ.Map) !void { const home_env = env.get("HOME") orelse return error.NoHomeDirectory; const home_dir = try std.Io.Dir.openDirAbsolute(io, home_env, .{}); defer home_dir.close(io); const zproj_dir = home_dir.openDir(io, ".config/zproj", .{}) catch |err| switch (err) { erro...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.