M
Mischa Berger
Hi everyone,
Consider the following code:
# Save the file on the file system
File.open(self.temp_path, 'wb') do |f|
while buff = myfile_field.read(4096)
f.write(buff)
f.flush
end
end
Is there any benefit in flushing in the code above?
Does this mean 4096 bytes of memory are freed everytime flush is called?
I'm trying to grasp what exactly happens and if there are any benefits
or drawbacks.
Thanks,
Mischa
Consider the following code:
# Save the file on the file system
File.open(self.temp_path, 'wb') do |f|
while buff = myfile_field.read(4096)
f.write(buff)
f.flush
end
end
Is there any benefit in flushing in the code above?
Does this mean 4096 bytes of memory are freed everytime flush is called?
I'm trying to grasp what exactly happens and if there are any benefits
or drawbacks.
Thanks,
Mischa