I have an app hosted @ Heroku. The app depends on some feeds which are fetched using a socket listener. The socket listener gets one line of XML per second. Once I detect th
With the newer Heroku-16 stack, you are able to write to both the root and to /tmp
Try writing to root with
f = File.new("filename.txt", 'w')
f << "hi there"
f.close
Dir.entries(Dir.pwd) # see your newly created file
Or to /tmp
with
f = File.new("tmp/filename.txt", 'w')
f << "hi there"
f.close
Dir.entries(Dir.pwd.to_s + ("/tmp"))
You will see your new file among those listed in both cases
Also try running heroku restart
to see your newly created files disappear! This is expected, as heroku storage is ephemeral (will be deleted when the app restarts) - so don't rely on it for anything more than (very) temporary storage