Logo
Explore Help
Sign In
renun/koreader
1
0
Fork 0
You've already forked koreader
mirror of https://github.com/koreader/koreader.git synced 2025-08-10 00:52:38 +00:00
Code Issues Actions Packages Projects Releases Wiki Activity
Files
c797bb53a4e32affc80643ef0294826bbcabc263
koreader/datastorage.lua

15 lines
296 B
Lua
Raw Normal View History

add datastorage module to handle data directory on various platform On kindle, kobo and pocketbook the data directory is the current running directory but on Android the app is installed in system defined location and users may have no access to that location. The same circumstances should be true for the upcoming Koreader for Ubuntu touch, so the data directory (in which tessdata, dictionaries, global settings, persistant defaults and probably history data are stored) could be stored in another place.
2015-06-15 16:46:43 +08:00
-- need low-level mechnism to detect android to avoid recursive dependency
local isAndroid = pcall(require, "android")
local DataStorage = {}
function DataStorage:getDataDir()
if isAndroid then
return "/sdcard/koreader/"
else
return "./"
end
end
return DataStorage
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.5 Page: 60ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API