From 533db3e807e86e88b35767b4aaf842990399e2ba Mon Sep 17 00:00:00 2001 From: Pat Hickey Date: Sat, 30 Jan 2021 13:39:03 -0800 Subject: [PATCH] virtfs: implement a bunch more --- crates/wasi-common/virtfs/src/lib.rs | 203 +++++++++++++++++++++++++-- 1 file changed, 194 insertions(+), 9 deletions(-) diff --git a/crates/wasi-common/virtfs/src/lib.rs b/crates/wasi-common/virtfs/src/lib.rs index 9f000ca57a..8fcd868dec 100644 --- a/crates/wasi-common/virtfs/src/lib.rs +++ b/crates/wasi-common/virtfs/src/lib.rs @@ -2,7 +2,7 @@ use cap_std::time::{Duration, SystemTime}; use std::any::Any; use std::cell::{Cell, Ref, RefCell, RefMut}; -use std::collections::HashMap; +use std::collections::{hash_map::Entry, HashMap}; use std::convert::TryInto; use std::io::{Cursor, IoSlice, IoSliceMut, Read, Seek, SeekFrom, Write}; use std::ops::Deref; @@ -16,12 +16,52 @@ use wasi_common::{ }; pub struct Filesystem { - root: Rc>, + // Always .get() out a Some - this is an RefCell