aldenml/libtorrent4j

Is it possible to implement a custom storage?

proninyaroslav opened this issue · 3 comments

libtorrent by default allows to implement custom storage https://www.libtorrent.org/reference-Custom_Storage.html. One idea is to implement a storage that works with raw file descriptors, not filesystem paths. Is it possible? This could solve some problems, for example, add support for the Android Storage Access Framework, which only provides access to file descriptors.

Hello @aldenml. Can you comment on this, please :)

Hi @proninyaroslav, sorry for the late response :)

I explored this idea in the past. The problem at that moment was that you need to provide almost a full re-implementation of the storage vs just overriding the interaction with the filesystem. The interaction with and assumption that you are in a posix-compatible system is hard to isolate.

I will keep this open to look at it again.

That would be very nice. I think it's better than using a POSIX hack that didn't work in many cases.