func (f *File) Duplicate(src *File) error {
	if err := src.Open(os.O_RDONLY); err != nil {
		return err
	}
	if err := f.Open(os.O_CREATE | os.O_RDWR | os.O_TRUNC); err != nil {
		return err
	}
	if _, err := io.Copy(f, src); err != nil {
		return err
	}
	if err := f.Close(); err != nil {
		return err
	}
	return src.Close()
}
// Duplicate clones a source File to this File's destination
Duplicate clones a source File to this File's destination
// Duplicate clones a source File to this File ' s destination
func (f *File) Duplicate(src *File) error {
	if err := src.Open(os.O_RDONLY); err != nil {
		return err
	}
	if err := f.Open(os.O_CREATE | os.O_RDWR | os.O_TRUNC); err != nil {
		return err
	}
	if _, err := io.Copy(f, src); err != nil {
		return err
	}
	if err := f.Close(); err != nil {
		return err
	}
	return src.Close()
}
func ( f * File ) Duplicate ( src * File ) error { if err := src . Open ( os . O_RDONLY ) ; err != nil { return err } if err := f . Open ( os . O_CREATE | os . O_RDWR | os . O_TRUNC ) ; err != nil { return err } if _ , err := io . Copy ( f , src ) ; err != nil { return err } if err := f . Close ( ) ; err != nil { return err } return src . Close ( ) }
Duplicate clones a source File to this File's destination
Duplicate clones a source File to this File ' s destination