diff --git a/fuseops/ops.go b/fuseops/ops.go index 8f67841..f786474 100644 --- a/fuseops/ops.go +++ b/fuseops/ops.go @@ -456,7 +456,11 @@ type OpenFileOp struct { // a particular inode go through the kernel, set this field to true to // disable this behavior. // - // More discussion: http://goo.gl/cafzWF + // (More discussion: http://goo.gl/cafzWF) + // + // Note that on OS X it appears that the behavior is always as if this field + // is set to true, regardless of its value, at least for files opened in the + // same mode. (Cf. https://github.com/osxfuse/osxfuse/issues/223) KeepPageCache bool } diff --git a/samples/cachingfs/caching_fs_test.go b/samples/cachingfs/caching_fs_test.go index 5634034..19cdf39 100644 --- a/samples/cachingfs/caching_fs_test.go +++ b/samples/cachingfs/caching_fs_test.go @@ -616,6 +616,12 @@ func (t *PageCacheTest) SingleFileHandle_KeepCache() { func (t *PageCacheTest) TwoFileHandles_NoKeepCache() { t.fs.SetKeepCache(false) + // SetKeepCache(false) doesn't work on OS X. See the notes on + // OpenFileOp.KeepPageCache. + if runtime.GOOS == "darwin" { + return + } + // Open the file. f1, err := os.Open(path.Join(t.Dir, "foo")) AssertEq(nil, err)