[edit] è¦ç´ æååã« IO ã¨åãã¤ã³ã¿ãã§ã¼ã¹ãæãããããã®ã¯ã©ã¹ã§ãã ä¾ require "stringio" sio = StringIO.new("hoge", 'r+') p sio.read #=> "hoge" sio.rewind p sio.read(1) #=> "h" sio.write("OGE") sio.rewind p sio.read #=> "hOGE" ä¾å¤ StringIO ãªãã¸ã§ã¯ãã¯å¤§æµã®å ´å IO ãªãã¸ã§ã¯ãã¨åãä¾å¤ãçºçããã¾ããä¾ãã°æ¬¡ã®ä¾ã§ã¯ write 㯠IOError ãçºçããã¾ãã ä¾ require "stringio" sio = StringIO.new("hoge") sio.close sio.write("a") # => in `write': not opened for writing (IOE
{{#tags}}- {{label}}
{{/tags}}