Sam01/30/2023, 1:14 PM
Andrei Salavei01/30/2023, 1:15 PM
Sam01/30/2023, 1:16 PM
implementations easily enough, it's getting hold of the directory path to write to that I'm struggling with
Andrei Salavei01/30/2023, 1:19 PM
method that returns cache directory path for each platform. Do you?
Sam01/30/2023, 1:20 PM
val paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, true); val cacheDirectory = paths.first()
Vidmantas Kerbelis01/30/2023, 1:38 PM
is your friend here. If you want to get a
and do something with it in common code. So CRUD operations, or w/e.. Then you probably need something like Okio and use
to open the appropriate files from the cache.
Sam01/30/2023, 1:47 PM
Vidmantas Kerbelis01/30/2023, 1:54 PM
context.cacheDir (File), so for the path, it would be cacheDir.absolutePath (or relativePath)
Sam01/30/2023, 1:55 PM
Vidmantas Kerbelis01/30/2023, 1:56 PM
, so you must do it on the Android platform’s side sadly
Sam01/30/2023, 1:58 PM
Jeff Lockhart01/30/2023, 11:49 PM
in common code. It embeds the Android
within the coroutine context, which then can be used by Android actual suspend functions on file systems objects like cacheVfs. You just need to call
from the Android code the calls the common code (example).