I'm downloading a folder from S3 using Ruby and aws-sdk. How to check if each file is downloaded successfully? Is it simply a check if file exist on local machine?
File.open("#{meeting_dir}/#{o.key}","wb") do |f|
f.write(o.read)
end
I'm downloading a folder from S3 using Ruby and aws-sdk. How to check if each file is downloaded successfully? Is it simply a check if file exist on local machine?
File.open("#{meeting_dir}/#{o.key}","wb") do |f|
f.write(o.read)
end
you can check the file size of the amazon key with S3Object#content_length
method and compare it with the size of the downloaded file File.size 'downloaded_file'
.
http://docs.aws.amazon.com/AWSRubySDK/latest/AWS/S3/S3Object.html#content_length-instance_method