Read and write files inside a running sandbox
sb.fs().write("/app/config.json", r#"{"debug": true}"#).await?;
let content = sb.fs().read_to_string("/app/config.json").await?;
let entries = sb.fs().list("/app").await?;
for entry in entries {
println!("{}: {:?}", entry.path, entry.kind);
}
let mut stream = sb.fs().read_stream("/app/data.bin").await?;
while let Some(chunk) = stream.next().await {
process(chunk?);
}
sb.fs().copy_from_host("./local-file.txt", "/app/remote-file.txt").await?;