Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions check_env_demo/code/native-lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

extern "C" JNIEXPORT jint JNICALL
Java_check_env_MainActivity_isPathReallyExist(JNIEnv *env, jobject, jstring path) {
const char *cpath = env->GetStringUTFChars(path, nullptr);
int result1 = syscall(__NR_faccessat,AT_FDCWD, cpath, F_OK, 0);
return result1;
}
public int isPathReallyExist(String path) {
return new File(path).exists() ? 1 : 0;
}