Native MEGA backend

Hello Rclone forum.

Recently i've been trying to make rclone compatible with the C++ MEGA-SDK.
Firstly i've made working MEGA-SDK SWIG bindings (it has a pr).
Then written a small compatibility layer with Rclone.
The main motivation is speed, as im one of the people who has trouble with the performance of the go library.

This has some benefits and drawbacks:
The obvious benefit is speed (and compatibility for people running the webdav server).
But it has alot of downsides, mainly shipping, given that it would have to include all the MEGA-SDK headers, and compile the SDK in a static and crossplatform way, and ship it.
It doesn't have an upload bytes/chunks interface, so i opted to simply create a file which i write to first, then pass the filename to the SDK, but thats minor in my book.
The SDK also creates its own state files which it doesn't delete as of this time.

The main question is if this would ever be merge/packageable with mainline.
I haven't worked extensively with golang so i couldn't tell if there was a "smart" way to do this, except maybe patch-sets, or if the maintainer will even allow it.

The git is here if your curious, you probably cant compile it because i rely on symlinks right now:

I would also recommend not running as of this time, as i cant promise that its currently safe because it has not been extensively tested.

Sounds interesting, thank you for your work.

hi, i took a look, and it is an interesting approach.

as for native, currently, the simple solution is to run official megacmd cli in webdav server mode and have rclone connect to that webdav server.
i have done that, works well, except does not support hash checksums and changing modtime.

Imma tell you, integration.
In my experience with the webdav server, if a file fails for any serverside reason, it stalls indefinitely.
Mine detects errors, and returns them (and doesnt stall).
The webdav server also has a long standing non-compliance bug with not being able to rename folders in certain situations.
Its also way easier to setup and has all the configuration in rclone itself.

But with that said, i now see that merging is probably a no-go because of the library dependency, so it'll probably remain my little fun project forever.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.