On systems that do not support open_memstream a temporary file is created. While this works, it is slower than using the in-memory version.
BSD-based systems (including Android and Mac OS) have funopen that allows creating custom FILE objects. There are various open_memstream compatibility layers available, e.g.:
- https://code.google.com/p/tesseract-android-tools/source/browse/tesseract-android-tools/jni/com_googlecode_leptonica_android/stdio/open_memstream.c?r=f5c859a3bd7cd1e1efba38050fb6b79244971df9
- https://github.com/shyuep/pyhull/tree/master/src/fmemopen
Adapting one of these will allow in-memory file stream support on more platforms (i.e. everything other than Windows).
---
Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/2796597-create-an-open_memstream-compatiblity-layer?utm_campaign=plugin&utm_content=tracker%2F254961&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F254961&utm_medium=issues&utm_source=github).
On systems that do not support
open_memstreama temporary file is created. While this works, it is slower than using the in-memory version.BSD-based systems (including Android and Mac OS) have
funopenthat allows creating customFILEobjects. There are variousopen_memstreamcompatibility layers available, e.g.:Adapting one of these will allow in-memory file stream support on more platforms (i.e. everything other than Windows).
--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/2796597-create-an-open_memstream-compatiblity-layer?utm_campaign=plugin&utm_content=tracker%2F254961&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F254961&utm_medium=issues&utm_source=github).