1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-24 01:54:22 +00:00

Android: ensure that temp directory exists before returning a path to it.

This fixes “no such file or directory” error when calling open() for a file for which parent directory does not exist.
This commit is contained in:
Lukasz Kozakiewicz 2017-08-29 15:02:05 +01:00
parent 9b687968db
commit f0ada66b0f

View file

@ -105,7 +105,11 @@ File File::getSpecialLocation (const SpecialLocationType type)
return File ("/system/app");
case tempDirectory:
return File (android.appDataDir).getChildFile (".temp");
{
File tmp = File (android.appDataDir).getChildFile (".temp");
tmp.createDirectory();
return File (tmp.getFullPathName());
}
case invokedExecutableFile:
case currentExecutableFile: