MCPcopy Create free account
hub / github.com/Singular/Singular / WriteFile

Function WriteFile

ppcc/adlib/os.cc:34–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32}
33
34int WriteFile(FILE *fp, Str *data) {
35 char *p = data->c_str();
36 Int len = data->len();
37 while (len != 0) {
38 Int written = fwrite(p, 1, len, fp);
39 if (written == 0)
40 return 0;
41 len -= written;
42 p += written;
43 }
44 return 1;
45}
46
47int WriteFile(const char *filename, Str *data) {
48 FILE *fp = fopen(filename, "w");

Callers 2

MainFunction · 0.85
WriteProcessFunction · 0.85

Calls 2

c_strMethod · 0.80
lenMethod · 0.45

Tested by 1

MainFunction · 0.68