This site works best with JavaScript enabled. Please enable JavaScript to get the best experience from this site.
Today I createt for one of my Mods a small function to delete files, maybe someone needs this function, too, just put it on the top of your Mod and call it whenever you need it:
function deleteFile(path, filename) {
try {
java.io.File(path).mkdirs();
var theFile = new java.io.File(path, filename);
theFile.delete();
}catch(err){
print("An Error occurred: " + err);
}
If you have any questions just ask here
Thank you! This is just what i needed and it works really well. Thank you very much!
Example:
function procCmd(cmd){
if(cmd=="test"){
deleteFile("storage/emulated/0/house/","house.js");
It will be useful in hardcore mode mod!
A modder come from Taiwan.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumToday I createt for one of my Mods a small function to delete files, maybe someone needs this function, too, just put it on the top of your Mod and call it whenever you need it:
function deleteFile(path, filename) {
try {
java.io.File(path).mkdirs();
var theFile = new java.io.File(path, filename);
theFile.delete();
}catch(err){
print("An Error occurred: " + err);
}
}
If you have any questions just ask here
Thank you! This is just what i needed and it works really well. Thank you very much!
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumExample:
function deleteFile(path, filename) {
try {
java.io.File(path).mkdirs();
var theFile = new java.io.File(path, filename);
theFile.delete();
}catch(err){
print("An Error occurred: " + err);
}
}
function procCmd(cmd){
if(cmd=="test"){
deleteFile("storage/emulated/0/house/","house.js");
}
}
It will be useful in hardcore mode mod!
A modder come from Taiwan.