File.truncate(file_name, integer) â 0
Class Public methods
Truncates the file file_name to be at most integer bytes
long. Not available on all platforms.
f = File.new("out", "w")
f.write("1234567890") #=> 10
f.close #=> nil
File.truncate("out", 5) #=> 0
File.size("out") #=> 5