lib/rmega/nodes/downloadable.rb in rmega-0.3.1 vs lib/rmega/nodes/downloadable.rb in rmega-0.3.2

- old
+ new

@@ -20,11 +20,11 @@ @file_io_mutex ||= Mutex.new @file_io_mutex.synchronize(&block) end def allocated?(path) - ::File.exists?(path) and ::File.size(path) == filesize + ::File.exist?(path) and ::File.size(path) == filesize end # Writes a buffer in the local file, starting from the start-n byte. def write_chunk(start, buffer) file_io_synchronize do @@ -65,10 +65,10 @@ return aes_cbc_mac(@node_key.aes_key, data, mac_iv) end def download(path) path = ::File.expand_path(path) - path = Dir.exists?(path) ? ::File.join(path, name) : path + path = Dir.exist?(path) ? ::File.join(path, name) : path progress = Progress.new(filesize, caption: 'Allocate', filename: self.name) pool = Pool.new @resumed_download = allocated?(path)