ready for v1.0rc1

This commit is contained in:
ston1th 2019-05-06 21:14:24 +02:00
commit ce5764840f
15 changed files with 140 additions and 49 deletions

View file

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