Revert "have Stat() mimic os.Stat()'s error"

did this to make sure client received file not found error. changed
things so previous os.ErrNotExist works.
This commit is contained in:
John Eikenberry 2016-07-22 20:31:37 -07:00
parent 69cd74c3d1
commit b387807529
1 changed files with 2 additions and 2 deletions

View File

@ -100,6 +100,7 @@ func (fs *root) Fileinfo(r *Request) ([]os.FileInfo, error) {
switch r.Method {
case "List":
list := []os.FileInfo{}
fmt.Println("ls", r.Filepath)
for fn, fi := range fs.files {
if filepath.Dir(fn) == r.Filepath {
fmt.Println(fn, fi.Name())
@ -110,8 +111,7 @@ func (fs *root) Fileinfo(r *Request) ([]os.FileInfo, error) {
case "Stat":
file, err := fs.fetch(r.Filepath)
if err != nil {
// mimic os.Stat() return error
return nil, &os.PathError{"stat", r.Filepath, syscall.ENOENT}
return nil, err
}
return []os.FileInfo{file}, nil
case "Readlink":