ready for v1.0rc1
This commit is contained in:
parent
84d48a6eea
commit
ce5764840f
15 changed files with 140 additions and 49 deletions
|
|
@ -8,6 +8,7 @@ import (
|
|||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
type Mode int
|
||||
|
|
@ -34,10 +35,11 @@ func (fs *Filesystem) GetFile(path string) (f *os.File, fi os.FileInfo, err erro
|
|||
return
|
||||
}
|
||||
|
||||
func (fs *Filesystem) Mode(path string) (mode Mode, err error) {
|
||||
func (fs *Filesystem) Mode(path string) (mode Mode, enoent bool, err error) {
|
||||
p := filepath.Join(fs.Base, Clean(path))
|
||||
fi, err := os.Stat(p)
|
||||
if err != nil {
|
||||
enoent = err.(*os.PathError).Err == syscall.ENOENT
|
||||
return
|
||||
}
|
||||
m := fi.Mode()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue