diff --git a/lib/fog/rackspace/docs/storage.md b/lib/fog/rackspace/docs/storage.md index 99c5069d9..6f9b63feb 100644 --- a/lib/fog/rackspace/docs/storage.md +++ b/lib/fog/rackspace/docs/storage.md @@ -382,8 +382,8 @@ Cloud Files requires files larger than 5 GB to be uploaded into segments along w read = 0 # upload segment to cloud files service.put_object("my_container", "large_file/#{segment}", nil, options = {}) do - if (offset < SEGMENT_LIMIT) && (read.zero? || read == BUFFER_SIZE) - buf = f.sysread(BUFFER_SIZE) + if (offset < SEGMENT_LIMIT) && !f.eof? + buf = f.read(BUFFER_SIZE) read = buf.size offset += read buf diff --git a/lib/fog/rackspace/examples/storage/upload_large_files.rb b/lib/fog/rackspace/examples/storage/upload_large_files.rb index 270d414bb..33443feef 100644 --- a/lib/fog/rackspace/examples/storage/upload_large_files.rb +++ b/lib/fog/rackspace/examples/storage/upload_large_files.rb @@ -69,9 +69,9 @@ File.open(file_name) do |f| offset = 0 read = 0 service.put_object(directory.key, "#{segment_name}/#{segment}", nil, options = {}) do - if (offset < SEGMENT_LIMIT) && (read.zero? || read == BUFFER_SIZE) + if (offset < SEGMENT_LIMIT) && !f.eof? print "." - buf = f.sysread(BUFFER_SIZE) + buf = f.read(BUFFER_SIZE) read = buf.size offset += read buf