Flowdock
truncate(p1) public

Truncates file to at most integer bytes. The file must be opened for writing. Not available on all platforms.

   f = File.new("out", "w")
   f.syswrite("1234567890")   #=> 10
   f.truncate(5)              #=> 0
   f.close()                  #=> nil
   File.size("out")           #=> 5
Show source
Register or log in to add new notes.