Created
December 18, 2014 21:47
-
-
Save ryanstout/ea80059854254d3e6160 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (fh *FileHandle) Read(req *fuse.ReadRequest, resp *fuse.ReadResponse, intr fs.Intr) fuse.Error { | |
// fmt.Printf("Read %s - %d at %d\n", fh.FuseFile.Path, req.Size, req.Offset) | |
buf := make([]byte, req.Size) | |
// fmt.Printf("ReadAt: %d -- %d -- %d - %s\n", req.Offset, req.Size, len(resp.Data), fh.FuseFile.Path) | |
size, err := fh.File.ReadAt(buf, req.Offset) | |
if err != nil && err != io.EOF { | |
fmt.Printf("ERR FROM READ: %s\n", err) | |
// return fuse.EIO | |
return err | |
} | |
// | |
// fmt.Printf("Read %d bytes at %s\n", size, fh.FuseFile.Path) | |
resp.Data = buf[:size] | |
return nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment