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

Function create_file

test/stat/test_stat.c:29–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27#endif
28
29void create_file(const char *path, const char *buffer, int mode) {
30 int fd = open(path, O_WRONLY | O_CREAT | O_EXCL, mode);
31 assert(fd >= 0);
32
33 int err = write(fd, buffer, sizeof(char) * strlen(buffer));
34 assert(err == (sizeof(char) * strlen(buffer)));
35
36 close(fd);
37}
38
39#define TEST_TIME (1ll << 34)
40void setup() {

Callers 2

setupFunction · 0.70
testFunction · 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