part-cw / lambdanative

LambdaNative is a cross-platform development environment written in Scheme, supporting Android, iOS, BlackBerry 10, OS X, Linux, Windows, OpenBSD, NetBSD, FreeBSD and OpenWrt.
http://www.lambdanative.org
Other
1.4k stars 86 forks source link

Additional easy to use path for saving public data #455

Open bkmgit opened 5 months ago

bkmgit commented 5 months ago

There are architecture specific paths to the file system for internal use by an application which are set in system.c. For example on Android the following are defined:

Such a path may also be useful for downloads

If using this is problematic, then implementing some way of allowing the user to search the file system in a GUI and specify where they would like to save a file or open a file would be helpful, but seems more difficult to implement in a cross-platform manner.

mgorges commented 4 months ago

Correct, as per 212ab34, we now use getExternalFilesDirs as (system-directory), which is also accessible to outside tools; we also expose [getFilesDir](https://developer.android.com/reference/android/content/Context#getFilesDir()) as (system-appdirectory). The change is not backwards compatible (i.e. required manual migration of files) as the previous location on /sdcard is no longer accessible to us so I know of people who disabled the patch and others who use it depending on what is more important to you - maintaining access to old files or supporting newer versions of Android. The content (system-directory) should be visible to file browsers and adb to you, though, unless we broke something recently.

Finally, sure, we can expose getExternalStoragePublicDirectory easily if that is helpful, but I currently (and in the near future) do not have the capacity to build any new JNI-based file access pieces, so you'd have to submit a pull request for an implementation.

bkmgit commented 4 months ago

Ok, will make a pull request.