Login
|
Signup
langref.org
-
ruby
add..
all
clojure
cpp
csharp
erlang
fantom
fsharp
go
groovy
haskell
java
ocaml
perl
php
python
scala
Home
All
Solved
Unsolved
Strings
Numbers
Regex
Lists
Maps
Structure
Files
Dates
OOP
Networking
XML
Algorithms
Misc
Parallel
View Subcategory
Files
Writing
Write a string to a file
ruby
File.new("a_file", "w") << "some text"
Append to a file
ruby
file = File.new('/tmp/test.txt', 'a+') ; file.puts 'This line appended to file!!' ; file.close()