WebAssembly / wasi-cli

Command-Line Interface (CLI) World for WASI
60 stars 11 forks source link

Add an initial current working directory API. #8

Closed sunfishcode closed 1 year ago

sunfishcode commented 1 year ago

Add a function for returning an initial current working directory.

codefromthecrypt commented 1 year ago

appreciate the work on this. It would be nice to have this rendered in the canonical ABI or old witx so I can see the signature vs trying to calculate it in my head. Things are more abstract which has benefits, but it would also be nice to know what concretely this would become without mental transpiling.

sunfishcode commented 1 year ago

for components provided an empty set of preopens (i.e., the filesystem is required at link time, but at run time the world has decided not to provide any usable filesystem descriptors), this interface is not satisfiable - so instead, I think it needs to return an option<tuple<descriptor, string>>.

Good point; fixed.