probably fix the cat bug

This commit is contained in:
Jeromy 2014-11-07 13:06:21 -08:00 committed by Juan Batiz-Benet
parent 2e2d02a741
commit bc0e31922b

View File

@ -98,13 +98,20 @@ func (s *Node) Attr() fuse.Attr {
switch s.cached.GetType() {
case ftpb.Data_Directory:
return fuse.Attr{Mode: os.ModeDir | 0555}
case ftpb.Data_File, ftpb.Data_Raw:
size, _ := s.Nd.Size()
case ftpb.Data_File:
size := s.cached.GetFilesize()
return fuse.Attr{
Mode: 0444,
Size: uint64(size),
Blocks: uint64(len(s.Nd.Links)),
}
case ftpb.Data_Raw:
return fuse.Attr{
Mode: 0444,
Size: uint64(len(s.cached.GetData())),
Blocks: uint64(len(s.Nd.Links)),
}
default:
log.Error("Invalid data type.")
return fuse.Attr{}