require "stringio"
io = StringIO.new("hello".freeze)
io << "world"
require "stringio"
io = StringIO.new("hello".freeze)
io << "world"
# 💣 IOError: not opened for writing
require "stringio"
io = StringIO.new("hello".freeze)
io << "world"
# 💣 IOError: not opened for writing
io2 = StringIO.new("hello".freeze, "w+")
require "stringio"
io = StringIO.new("hello".freeze)
io << "world"
# 💣 IOError: not opened for writing
io2 = StringIO.new("hello".freeze, "w+")
# 💣 Errno::EACCES: Permission denied
require "stringio"
io = StringIO.new("hello".freeze)
io << "world"
# 💣 IOError: not opened for writing
io2 = StringIO.new("hello".freeze, "w+")
# 💣 Errno::EACCES: Permission denied
io3 = StringIO.new("hello".freeze, File::RDWR)
require "stringio"
io = StringIO.new("hello".freeze)
io << "world"
# 💣 IOError: not opened for writing
io2 = StringIO.new("hello".freeze, "w+")
# 💣 Errno::EACCES: Permission denied
io3 = StringIO.new("hello".freeze, File::RDWR)
# 💣 Errno::EACCES: Permission denied
File.open("my-file.txt", "r")