I have a fascinating issue where I zip up a whole directory but intermittently a single file does not make it into the zip archive - even though it seems identical in perms to all the rest, and even though I can “see” the call to ZipFile::Builder::addFile going off!
I realized that in fact that file is being written just before I create the archive, and in the very same thread - so there can’t be more than a few microseconds between its creation and when it’s added to the archive. The file is successfully seen by my DirectoryIterator, ZipFile::Builder::addFile is successfully called on it, and yet that file, only, is not included in the .zip archive - it’s as if whatever builds the zip file hasn’t “caught up” with the actual state of the disk yet…!
If I, for example, write the file, sleep the thread for 100ms, and then create the archive, it works perfectly well every time.
I’m actually perfectly satisfied with that solution, because it’s an operation that’s only called once, and that rarely. However, this seems like a potential issue, and I thought I should report it.
My system stats:
juce_version: "JUCE v2.0.18"
operating_system_name: "Mac OSX 10.6"
full_user_name: "Tom Ritchford"
which amusingly enough happen to be the contents of the file that refuses to save!