MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / write_file

Function write_file

test/other/test_fs_icase.cpp:23–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21// TODO: check ignore case backend mounted under a different backend.
22
23void write_file(const char* fname) {
24 FILE* fp = fopen(fname, "wt");
25 assert(fp);
26 char data[] = "test";
27 printf("Write '%s' to '%s'\n", data, fname);
28 assert(fputs(data, fp) >= 0);
29 assert(fclose(fp) == 0);
30}
31
32void read_file(const char* fname) {
33 FILE* fp = fopen(fname, "rt");

Callers 1

mainFunction · 0.70

Calls 5

fopenFunction · 0.85
printfFunction · 0.85
fputsFunction · 0.85
fcloseFunction · 0.85
assertFunction · 0.50

Tested by

no test coverage detected