fails:File#truncate raises an IOError if file is not opened for writing
