fileutil_darwin.go 761 B

1234567891011121314151617181920212223242526272829
  1. // Copyright (c) 2014 The fileutil Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // +build !arm
  5. package fileutil
  6. import (
  7. "io"
  8. "os"
  9. )
  10. const hasPunchHole = false
  11. // PunchHole deallocates space inside a file in the byte range starting at
  12. // offset and continuing for len bytes. Not supported on OSX.
  13. func PunchHole(f *os.File, off, len int64) error {
  14. return nil
  15. }
  16. // Fadvise predeclares an access pattern for file data. See also 'man 2
  17. // posix_fadvise'. Not supported on OSX.
  18. func Fadvise(f *os.File, off, len int64, advice FadviseAdvice) error {
  19. return nil
  20. }
  21. // IsEOF reports whether err is an EOF condition.
  22. func IsEOF(err error) bool { return err == io.EOF }