From daf7a87d8f9aca2b7c6effb9cc083a9a9ff9f115 Mon Sep 17 00:00:00 2001 From: Steve Francia Date: Tue, 8 Dec 2015 21:48:19 -0500 Subject: [PATCH] Make "findParent" work on Windows properly Fixes #31 --- memmap.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/memmap.go b/memmap.go index caa0cf3..06799c6 100644 --- a/memmap.go +++ b/memmap.go @@ -18,7 +18,6 @@ import ( "fmt" "log" "os" - "path" "path/filepath" "sort" "strings" @@ -118,8 +117,8 @@ func (m *MemMapFs) unRegisterWithParent(fileName string) { } func (m *MemMapFs) findParent(f File) File { - pdir, _ := path.Split(f.Name()) - pdir = path.Clean(pdir) + pdir, _ := filepath.Split(f.Name()) + pdir = filepath.Clean(pdir) pfile, err := m.lockfreeOpen(pdir) if err != nil { return nil @@ -133,7 +132,7 @@ func (m *MemMapFs) registerWithParent(f File) { } parent := m.findParent(f) if parent == nil { - pdir := filepath.Dir(path.Clean(f.Name())) + pdir := filepath.Dir(filepath.Clean(f.Name())) err := m.lockfreeMkdir(pdir, 0777) if err != nil { //log.Println("Mkdir error:", err)