mirror of https://github.com/spf13/afero.git
don't return error in CopyOnWriteFs OpenFile if it is a not exist error
fixes #78
This commit is contained in:
parent
beda367433
commit
8404a5e8bf
|
@ -1,11 +1,11 @@
|
||||||
package afero
|
package afero
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"syscall"
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
"fmt"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// The CopyOnWriteFs is a union filesystem: a read only base file system with
|
// The CopyOnWriteFs is a union filesystem: a read only base file system with
|
||||||
|
@ -147,7 +147,7 @@ func (u *CopyOnWriteFs) OpenFile(name string, flag int, perm os.FileMode) (File,
|
||||||
|
|
||||||
dir := filepath.Dir(name)
|
dir := filepath.Dir(name)
|
||||||
isaDir, err := IsDir(u.base, dir)
|
isaDir, err := IsDir(u.base, dir)
|
||||||
if err != nil {
|
if err != nil && !os.IsNotExist(err) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if isaDir {
|
if isaDir {
|
||||||
|
|
Loading…
Reference in New Issue