perhaps now I can remove some of the "helper" actions in vfs, like ReadAt, and just let users do what they would've done with std::fs anyway but with our std_lib, that is call .seek() and then .write()
examples of usage of a file:
let drive = create_drive(our.package_id(), "testing")?;
let test_file = format!("{}/test.txt", path);
// open/create and write file
let mut file = open_file(path, true)?;
let bytestring = message.into_bytes();
file.write(&bytestring)?; // "yes hello"
// different action, can open again, seek to start etc, read into buffer len:
let mut buffer = vec![0; 3];
file.read(&mut buffer)?;
let string = String::from_utf8(buffer)?;
println!("vfstester: read {:?}", string); // "yes"
some impl functions!
perhaps now I can remove some of the "helper" actions in vfs, like ReadAt, and just let users do what they would've done with std::fs anyway but with our std_lib, that is call .seek() and then .write()
examples of usage of a file:
full test lib.rs: https://gist.github.com/bitful-pannul/b7cbdaafaef9b9056794d2c20507ce21