marine-rs-sdk
marine-rs-sdk copied to clipboard
to_host_path: function to convert service path to host path via mappedDirs
Consider this use-case:
/tmp => /.fluence/v1/services/workdir/5c911af0-0e22-4a6c-bdd2-c6a376e2cf69/tmp
/tmp/vault => /.fluence/v1/stepper/particles/vault
I want to download file via curl or ipfs and specify output to /tmp/vault/XXX
.
So I want to do
let cmd = ["-o", to_host_path("/tmp/vault/XXX")]
curl(cmd)
Please note that /tmp/
and /tmp/vault
share the same prefix. So to_host_path
should choose the longest prefix.