mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-02-02 11:04:00 +01:00
use /sdcard for android only if available
This commit is contained in:
parent
db0dfa1bf1
commit
153c275d74
11
FS.cpp
11
FS.cpp
|
@ -54,10 +54,15 @@ namespace fs {
|
||||||
dataDir = (home != NULL && strlen(home) > 0) ? home : "";
|
dataDir = (home != NULL && strlen(home) > 0) ? home : "";
|
||||||
dataDir += "/Library/Application Support/" + appName;
|
dataDir += "/Library/Application Support/" + appName;
|
||||||
return;
|
return;
|
||||||
//#elif defined(ANDROID)
|
|
||||||
// dataDir = "/sdcard/" + appName; // TODO: might not work for some devices //does throw & terminate on Android 6.0 (?) in i2p::fs::Init()+164
|
|
||||||
// return;
|
|
||||||
#else /* other unix */
|
#else /* other unix */
|
||||||
|
#if defined(ANDROID)
|
||||||
|
if (boost::filesystem::exists("/sdcard"))
|
||||||
|
{
|
||||||
|
dataDir = "/sdcard/" + appName;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// otherwise use /data/files
|
||||||
|
#endif
|
||||||
char *home = getenv("HOME");
|
char *home = getenv("HOME");
|
||||||
if (isService) {
|
if (isService) {
|
||||||
dataDir = "/var/lib/" + appName;
|
dataDir = "/var/lib/" + appName;
|
||||||
|
|
Loading…
Reference in a new issue