mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-04-26 13:01:34 +03:00
80625990d5
On Windows, it is sometimes problematic to depend on ws2_32.dll. Before, users of std.Io.Threaded would have to call ioBasic() rather than io() in order to avoid unnecessary dependencies on ws2_32.dll. Now, the application can disable networking with std.Options. This change is necessary due to moving networking functionality to be based on Io.Operation, which is a tagged union.
14 lines
383 B
Zig
14 lines
383 B
Zig
pub fn main(init: std.process.Init) !void {
|
|
const arena = init.arena.allocator();
|
|
const args = try init.minimal.args.toSlice(arena);
|
|
|
|
if (args.len != 2) return error.BadUsage;
|
|
const path = args[1];
|
|
|
|
const io = std.Io.Threaded.global_single_threaded.io();
|
|
|
|
std.Io.Dir.cwd().access(io, path, .{}) catch return error.AccessFailed;
|
|
}
|
|
|
|
const std = @import("std");
|