complement weed mount

This commit is contained in:
sparklxb 2017-03-10 14:45:53 +08:00
parent 7f85e15990
commit 3a67b6ddc1
2 changed files with 2 additions and 13 deletions

View file

@ -107,8 +107,6 @@ func (dir *Dir) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error) {
return ret, nil return ret, nil
} }
const greeting = "hello, world\n"
type File struct { type File struct {
Id uint64 Id uint64
// FileId filer.FileId // FileId filer.FileId
@ -117,11 +115,6 @@ type File struct {
func (file *File) Attr(context context.Context, attr *fuse.Attr) error { func (file *File) Attr(context context.Context, attr *fuse.Attr) error {
attr.Inode = file.Id attr.Inode = file.Id
attr.Mode = 0444 attr.Mode = 0000
attr.Size = uint64(len(greeting))
return nil return nil
} }
func (file *File) ReadAll(ctx context.Context) ([]byte, error) {
return []byte(greeting), nil
}

View file

@ -27,11 +27,7 @@ func (fs *FilerServer) apiHandler(w http.ResponseWriter, r *http.Request) {
writeJsonQuiet(w, r, http.StatusOK, res) writeJsonQuiet(w, r, http.StatusOK, res)
case "listFiles": case "listFiles":
res := filer.ListFilesResult{} res := filer.ListFilesResult{}
limit := 1 res.Files, err = fs.filer.ListFiles(apiRequest.Directory, apiRequest.FileName, 100)
if len(apiRequest.FileName) == 0 {
limit = 100
}
res.Files, err = fs.filer.ListFiles(apiRequest.Directory, apiRequest.FileName, limit)
if err != nil { if err != nil {
res.Error = err.Error() res.Error = err.Error()
} }