Commit 590e5940 authored by Aaron Jacobs's avatar Aaron Jacobs

Added tests for the behavior of dup and dup2 with regards to flushing.

parents f7264729 fef27210
...@@ -149,6 +149,27 @@ func (fs *flushFS) OpenFile( ...@@ -149,6 +149,27 @@ func (fs *flushFS) OpenFile(
return return
} }
func (fs *flushFS) ReadFile(
ctx context.Context,
req *fuse.ReadFileRequest) (
resp *fuse.ReadFileResponse, err error) {
resp = &fuse.ReadFileResponse{}
fs.mu.Lock()
defer fs.mu.Unlock()
// Ensure the offset is in range.
if req.Offset > int64(len(fs.fooContents)) {
return
}
// Read what we can.
resp.Data = make([]byte, req.Size)
copy(resp.Data, fs.fooContents[req.Offset:])
return
}
func (fs *flushFS) WriteFile( func (fs *flushFS) WriteFile(
ctx context.Context, ctx context.Context,
req *fuse.WriteFileRequest) ( req *fuse.WriteFileRequest) (
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment