Next, if all you wanted to do is read all the lines into an array, a method exists for doing that:
Thing is, I didn’t get the impression that’s what you were trying to do… usually one wants to do something with every line of text. You also were asking about a file browser.