libtorrent4j icon indicating copy to clipboard operation
libtorrent4j copied to clipboard

Is it possible to implement a custom storage?

Open proninyaroslav opened this issue 2 years ago • 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.

proninyaroslav avatar Dec 07 '21 14:12 proninyaroslav

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

proninyaroslav avatar Dec 13 '21 15:12 proninyaroslav

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.

aldenml avatar Dec 14 '21 17:12 aldenml

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

proninyaroslav avatar Dec 14 '21 17:12 proninyaroslav