mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Add file and dir temporary utilities
Co-authored by @Alex2782 for the Android bindings. Many thanks to the reviewers also. Co-authored-by: Alex <alex.hart.278@gmail.com>
This commit is contained in:
parent
d09d82d433
commit
1b3e483899
26 changed files with 331 additions and 7 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue