mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-21 10:27:46 +08:00
probably fix the cat bug
This commit is contained in:
parent
2e2d02a741
commit
bc0e31922b
@ -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{}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user