Method: TimeLogger#save
- Defined in:
- lib/openstudio/workflow/time_logger.rb
#save(filename) ⇒ Object
save the data to a file. This will overwrite the file if it already exists
87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/openstudio/workflow/time_logger.rb', line 87 def save(filename) File.open(filename, 'w') do |f| f << JSON.pretty_generate(@logger) # make sure data is written to the disk one way or the other begin f.fsync rescue StandardError f.flush end end end |