file_wrapper.go 400 B

123456789101112131415161718
  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. type fileWrapper struct {
  5. *os.File
  6. }
  7. func (f *fileWrapper) Close() error {
  8. //panic("I don't want anyone to close this file")
  9. // Ignore closers
  10. return nil
  11. }
  12. func (f *fileWrapper) RealClose() error {
  13. return f.File.Close()
  14. }