From 75dc847d59794d7561390e1450168cc53216ce1e Mon Sep 17 00:00:00 2001 From: Steve Francia Date: Wed, 2 Dec 2015 16:27:14 -0500 Subject: [PATCH] Start MemMapFS with a root directory. --- memmap.go | 4 ++++ 1 file changed, 4 insertions(+) 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 }