diff --git a/memmap.go b/memmap.go index 3bf85f7..efd0db7 100644 --- a/memmap.go +++ b/memmap.go @@ -44,6 +44,10 @@ func (m *MemMapFs) runlock() { m.getMutex().RUnlock() } func (m *MemMapFs) getData() map[string]File { if m.data == nil { m.data = make(map[string]File) + + // Root should always exist, right? + // TODO: what about windows? + m.getData()["/"] = &InMemoryFile{name: "/", memDir: &MemDirMap{}, dir: true} } return m.data }