From d58aeeec010283a360626747960505fd0e038999 Mon Sep 17 00:00:00 2001 From: AloneMonkey Date: Tue, 12 Dec 2017 19:48:06 +0800 Subject: [PATCH] add access --- dump.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dump.js b/dump.js index 4fcf4d7..d40d191 100644 --- a/dump.js +++ b/dump.js @@ -134,6 +134,7 @@ write = getExportFunction("f", "write", "int", ["int", "pointer", "int"]); lseek = getExportFunction("f", "lseek", "int64", ["int", "int64", "int"]); close = getExportFunction("f", "close", "int", ["int"]); remove = getExportFunction("f", "remove", "int", ["pointer"]); +access = getExportFunction("f", "access", "int", ["pointer", "int"]); function getDocumentDir() { var NSDocumentDirectory = 9; @@ -209,7 +210,10 @@ function dumpModule(name) { var newmodpath = getDocumentDir() + "/" + newmodname; var oldmodpath = modules[i].path; - remove(allocStr(newmodpath)); + + if(!access(allocStr(newmodpath),0)){ + remove(allocStr(newmodpath)); + } var fmodule = open(newmodpath, O_CREAT | O_RDWR, 0); var foldmodule = open(oldmodpath, O_RDONLY, 0);