diff --git a/copyOnWriteFs.go b/copyOnWriteFs.go index fa0c936..ed692ae 100644 --- a/copyOnWriteFs.go +++ b/copyOnWriteFs.go @@ -32,7 +32,7 @@ func (u *CopyOnWriteFs) isBaseFile(name string) (bool, error) { _, err := u.base.Stat(name) if err != nil { if oerr, ok := err.(*os.PathError); ok { - if oerr.Err == os.ErrNotExist || oerr.Err == syscall.ENOENT { + if oerr.Err == os.ErrNotExist || oerr.Err == syscall.ENOENT || oerr.Err == syscall.ENOTDIR { return false, nil } } @@ -80,7 +80,7 @@ func (u *CopyOnWriteFs) Stat(name string) (os.FileInfo, error) { if e, ok := err.(*os.PathError); ok { err = e.Err } - if err == syscall.ENOENT { + if err == syscall.ENOENT || err == syscall.ENOTDIR { return u.base.Stat(name) } return nil, origErr