-
-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow extern getFd()
to get file descriptors from Java for Kiwix Android
#852
Comments
@mgautierfr Any feedback here? |
Phrasing seems incorrect. Correct phrasing is: Issues on Android to fully (suggestions/ft search) use ZIM files when open via fd only (so without a - ZIM - file path). In such a case Xapian indexes can not be open (as they do require a dedicated fd, which can only be properly retrieved in "Java world" from the ZIM file path).
I answer here under the control of @mgautierfr, but "yes" you can open many fd from the same file. Each So. here I see only one solution: the libzim should be modified to allow an "external" |
SuggestionSearcher
and Archive
with existing FileDescriptorgetFd()
to get file descriptors from Java for Kiwix Android
This comment kiwix/libkiwix#1015 (comment) is interesting and must not be forgotten, and here an answer: Opening an archive with a list of |
@mgautierfr As I noted in the said comment, we convert a file descriptor to a file path (of the form |
The problem is that the trick may be not possible at all. Moving it to the user side move the problem outside of libzim but the root issue is still there: We cannot assume we can open by path (even |
We have an issue in Android directly accessing the fd via file path on Android 11 and above without
MANAGE_EXTERNAL_PERMISSION
(Which is special permission in Android and Play Store does not allow us to take this permission).Archive
andSuggestionSearcher
need the file path to work properly with the Xapian index as per conversation with @mgautierfr in kiwix/kiwix-android#3636. See kiwix/kiwix-android#3636 (comment) for more details.So to solve this issue can we open a new fd from the existing fd via
fileInputStream
API and use it for Xapian without affecting the existing one? Somehow this is possible at the libzim level. Or if you think of any better suggestion that can achieve this with existing fd would be welcome.The text was updated successfully, but these errors were encountered: