Just try nob_read_entire_file() on something like /proc/meminfo to reproduce this.
#define NOB_IMPLEMENTATION
#include "nob.h"
int main(void) {
String_Builder sb = {0};
if (!read_entire_file("/proc/meminfo", &sb))
return 1;
return 0;
}
This makes sense because virtual file systems like procfs are generated on the fly, without a size that fseek() expects to read so it can pass it to fread().
It may fail in other cases but I'm not entirely sure.
My point is, I think nob should be able to handle these types of files, or at least fail with a descriptive message explaining the issue.
Just try
nob_read_entire_file()on something like/proc/meminfoto reproduce this.This makes sense because virtual file systems like procfs are generated on the fly, without a size that
fseek()expects to read so it can pass it tofread().It may fail in other cases but I'm not entirely sure.
My point is, I think nob should be able to handle these types of files, or at least fail with a descriptive message explaining the issue.