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

Function create_file

test/other/test_mmap_empty.c:14–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12#include <sys/user.h>
13
14void create_file(const char* filename, const char* content) {
15 int fd = open(filename, O_RDWR|O_CREAT, S_IRUSR|S_IWUSR); // create an empty file
16 assert(fd >= 0);
17 write(fd, content, strlen(content));
18 close(fd);
19}
20
21int main() {
22 struct stat st;

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