lib/core/util/disk.rb in nucleon-0.1.3 vs lib/core/util/disk.rb in nucleon-0.1.4
- old
+ new
@@ -69,10 +69,13 @@
file = open(file_name, options)
if file
file.pos = 0 if options[:mode] == 'w'
success = file.write(data)
- file.flush
+ begin
+ file.flush
+ rescue # In case the file is already closed
+ end
return success
end
return nil
end