When I call this function the first time, sure enough it reads in the textfile as I want. The next time I call this function, with a different textfile it only reads in blanks. It doesn't pick up any newlines or anything else.
The textfiles haven't been corrupted or modified in anyway either.