Make "findParent" work on Windows properly

Fixes #31
This commit is contained in:
Steve Francia 2015-12-08 21:48:19 -05:00
parent e042b5f805
commit daf7a87d8f
1 changed files with 3 additions and 4 deletions

View File

@ -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)