You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Merge pull request #98397 from adamscott/add-tmp-support
Add temp utilities (alias `OS::get_temp_dir()`, `FileAccess::create_temp()`, and `DirAccess::create_temp()`)
This commit is contained in:
@@ -132,6 +132,18 @@ public class GodotIO {
|
||||
return activity.getCacheDir().getAbsolutePath();
|
||||
}
|
||||
|
||||
public String getTempDir() {
|
||||
File tempDir = new File(getCacheDir() + "/tmp");
|
||||
|
||||
if (!tempDir.exists()) {
|
||||
if (!tempDir.mkdirs()) {
|
||||
Log.e(TAG, "Unable to create temp dir");
|
||||
}
|
||||
}
|
||||
|
||||
return tempDir.getAbsolutePath();
|
||||
}
|
||||
|
||||
public String getDataDir() {
|
||||
return activity.getFilesDir().getAbsolutePath();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user