I want to extract zip files and delete them when they are extracted. Googling tells me that the easiest way to unzip files in Ruby is to execute them with unzip filename.zip. My next step is to delete the zip file.
The second step happens so fast that the shell command unzip does not have a chance to even see the file before it is deleted. It errors out saying
"unzip: cannot find either filename.zip or filename.zip.zip."
I just want to have the unzip... command complete before continuing execution of the ruby script. I want it to block synchronously. Is there a way to do that? I cannot use sleep because I cannot estimate how long it will take.