0

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
Cœur
  • 37,241
  • 25
  • 195
  • 267
Dzung Nguyen
  • 3,794
  • 9
  • 48
  • 86

1 Answers1

0

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

tadejm
  • 184
  • 6