Skip to content

Instantly share code, notes, and snippets.

/test.rb Secret

Created March 27, 2017 17:17
Show Gist options
  • Save anonymous/cb0b977c45fad4fdcb8a09b3de67d650 to your computer and use it in GitHub Desktop.
Save anonymous/cb0b977c45fad4fdcb8a09b3de67d650 to your computer and use it in GitHub Desktop.
open('result.txt', 'w') { |f|
f.puts id
f.puts exam
}
#I'm calling this inside a loop. But every time, the result.txt is created and removing the existing line. How can I keep the added lines?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment