Skip to content

Commit

Permalink
ls kinda sorta works
Browse files Browse the repository at this point in the history
  • Loading branch information
magik6k committed Oct 3, 2024
1 parent 0e25dba commit f038612
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions integrations/kuri/ribsplugin/9psrv.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ func (s *MfsSession) Read(ctx context.Context, fid p9p.Fid, p []byte, offset int
data := buf.Bytes()
if offset >= int64(len(data)) {
log.Debugf("Read: offset %d beyond data length %d", offset, len(data))
return 0, io.EOF
return 0, nil // Return zero bytes with no error
}
n = copy(p, data[offset:])
log.Debugf("Read: read %d bytes from directory fid %d", n, fid)
Expand Down Expand Up @@ -312,9 +312,10 @@ func (s *MfsSession) Read(ctx context.Context, fid p9p.Fid, p []byte, offset int
n, err = fc.fd.Read(p)
if err != nil && err != io.EOF {
log.Errorf("Read: error reading from fid %d: %v", fid, err)
} else {
log.Debugf("Read: read %d bytes from fid %d", n, fid)
} else if err == io.EOF {
err = nil // Return zero bytes with no error
}
log.Debugf("Read: read %d bytes from fid %d", n, fid)
return n, err
default:
log.Errorf("Read: unknown node type for fid %d", fid)
Expand Down Expand Up @@ -643,6 +644,9 @@ func (s *MfsSession) entryToDir(entry mfs.NodeListing) p9p.Dir {
Mode: uint32(0644),
Length: uint64(entry.Size),
ModTime: time.Unix(0, 0),

GID: "root",
UID: "root",
}

if qtype == p9p.QTDIR {
Expand Down

0 comments on commit f038612

Please sign in to comment.