This was very straightforward, and I'm amused I didn't do it sooner. The new "file.c" is just 113 lines, and includes wrappers for fopen, fgetc, fputc, and fwrite, along with a handy file_string function which reads the entire content of a file into a single string, using the very efficient buf.c technique.