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:
Thaddeus Crews 2024-12-03 14:40:59 -06:00
commit 156bc92282
No known key found for this signature in database
GPG key ID: 62181B86FE9E5D84
26 changed files with 331 additions and 7 deletions

View file

@ -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();
}