file_wrapper.go 418 B

1234567891011121314151617181920
  1. package basefs
  2. // Unfortunately Dropbox/net/http closes the file after sending (even if it is io.Reader only) and in this case we still need it locally open
  3. import "os"
  4. // osfileWrapper
  5. type fileWrapper struct {
  6. *os.File
  7. }
  8. func (f *fileWrapper) Close() error {
  9. //panic("I don't want anyone to close this file")
  10. // Ignore closers
  11. return nil
  12. }
  13. func (f *fileWrapper) RealClose() error {
  14. return f.File.Close()
  15. }