I've been test running zig recently, and have been able to pick up most of it by simply reading the standard library. However, I can't find anything similar to how we do perror/strerror
in C. Is there a way to get a string representation for operating system errors (errno
) in zig?
To be clear, I'm looking for a zig way to do this:
const char* path = "filethatdoesntexist.txt";
FILE* f = fopen(path,"rb");
if (!f) {
perror(path);
}