This is a great question!
The task of binary search is that the advantages of binary search are the ability to skip half the elements at each stage in O (1). This ensures that since you are only using O (log n) probes, the runtime is O (log n). That is why, for example, you can do a quick binary search in an array, but an unrelated list. In a linked list, finding half the point of elements takes linear time, which dominates the search time.
When performing a binary search in a file, you are in a similar position. Since all lines in a file may not have the same length, you cannot easily go to the nth line in a file with some number n. Therefore, implementing a good fast binary search in a file will be a bit more complicated. One way or another, you will need to know where each line starts and stops so that you can efficiently jump to the file.
There are many ways to do this. First, you can load all the lines from a file into an array, as you suggested. This takes linear time, but as soon as you have an array of strings in memory, all future binary searches will be very fast. The trick is that if you have a very large file, it can take up a lot of memory and can be overly expansive. Therefore, another alternative might not be storing the actual bites in an array, but rather an offset to the file in which each line occurs. This will allow you to quickly perform a binary search - you can search for a file with the appropriate offset when comparing - and for large bites it can be much more economical than indicated above. And, if all the lines are the same length, you can simply lay each line to a certain fixed size to allow direct calculation of the starting position of each line.
If you want to spend some time introducing more complex solutions, you can think about preprocessing the file so that instead of having one line per line, instead you have a list of fixed width integers at the top of the file containing the offsets of each line in file. This essentially does the job above, but then saves the result in a file to make future binary queries much faster. I have some experience with this kind of file structure, and it can be pretty fast.
If you are REALLY for a call, you can alternatively store the lines in a file using the B-tree, which would give you an incredibly fast search time for each line, minimizing the amount of disk reading you need to do.
Hope this helps!