I have a bug where calling `Tempfile#tell` once, at a particular point, changes the number of bytes that are written to the temp file. 🤦‍♂️

https://media.giphy.com/media/lvBTXzlnDNlZu/giphy.gif

@tom_dalling sounds like it’s not being synced properly? maybe setting “temp.sync = true” helps?
@judofyr rubyzip was duplicating the file descriptor and writing to it, but didn't bother to flush it at the end. The `tell` method must be flushing it. Turns out that duplicated Tempfile objects kind of synchronise with each other, but also kind of don't. Setting `sync = true` on the initial temp file, before it's dup'd, would probably work too.
@tom_dalling duplicated file descriptors have always confused me. I never know what is inherited and what is not…