| 361 | } |
| 362 | |
| 363 | extern "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 | |
| 385 | extern "C" JNIEXPORT void JNICALL |
| 386 | Java_java_io_File_delete(JNIEnv* e, jclass, jstring path) |
nothing calls this directly
no test coverage detected