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

Function create_file

test/other/test_umask.c:25–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23}
24
25void create_file(const char *path, const char *buffer) {
26 int fd = open(path, O_WRONLY | O_CREAT | O_EXCL, 0666);
27 assert(fd >= 0);
28
29 int err = write(fd, buffer, sizeof(char) * strlen(buffer));
30 assert(err == (sizeof(char) * strlen(buffer)));
31
32 close(fd);
33}
34
35int main() {
36 // Get the default umask

Callers 1

mainFunction · 0.70

Calls 5

strlenFunction · 0.85
openFunction · 0.50
assertFunction · 0.50
writeFunction · 0.50
closeFunction · 0.50

Tested by

no test coverage detected