I had an issue where downloading to a local file was locking it until I killed the ruby script. On a hunch, I changed the form of the call and now it doesn't lock the file.
Can someone tell me why the second form below doesn't lock the file but the first one does?
This form locks the local file:
open(ver_local_zip, "w+").write(open(remote_zip, :proxy=>ftp_proxy).read)
This form doesn't lock the file:
open(ver_local_zip, "w+") { |f| f.write(open(remote_zip, :proxy=>ftp_proxy).read) }
Thanks.