MCPcopy Create free account
hub / github.com/ReadyTalk/avian / Java_java_io_File_createNewFile

Function Java_java_io_File_createNewFile

classpath/java-io.cpp:363–383  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

361}
362
363extern "C" JNIEXPORT jboolean JNICALL
364 Java_java_io_File_createNewFile(JNIEnv* e, jclass, jstring path)
365{
366 bool result = false;
367 string_t chars = getChars(e, path);
368 if (chars) {
369 if (not exists(chars)) {
370 int fd = OPEN(chars, O_CREAT | O_WRONLY | O_EXCL, 0666);
371 if (fd == -1) {
372 if (errno != EEXIST) {
373 throwNewErrno(e, "java/io/IOException");
374 }
375 } else {
376 result = true;
377 doClose(e, fd);
378 }
379 }
380 releaseChars(e, path, chars);
381 }
382 return result;
383}
384
385extern "C" JNIEXPORT void JNICALL
386Java_java_io_File_delete(JNIEnv* e, jclass, jstring path)

Callers

nothing calls this directly

Calls 6

getCharsFunction · 0.85
existsFunction · 0.85
throwNewErrnoFunction · 0.85
releaseCharsFunction · 0.85
OPENFunction · 0.70
doCloseFunction · 0.70

Tested by

no test coverage detected