write string s to the ith file at record rec. For text files, rec is ignored and s is appended to the file. If rec is 0, s is written to the end of the file.