From: Mischa Berger Date: 2007-02-16T07:39:28+09:00 Subject: Does it make sense to flush and close? 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 -- Posted via http://www.ruby-forum.com/.