Thinking again, I think the first sample is more for specialized code, for generic code, for example a LogEvent method in your class, you need to open and close the file, and in that case StrToFile is not only a little bit faster (or let's say the same speed) but also more readable and less prone to error, for example in my first version when I moved the open and close inside the loop, I had forgotten fseek, which then did not write the file properly, as it kept overwriting it.
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?
"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare
"To die for a religion is easier than to live it absolutely"
Jorge L. Borges