I don't completely agree with jremington. What I would do is see if there is serial data to read. If so, open the file, read and write all available serial data, and close the file.
This way, the file is open only as long as needed, so the risk of data loss is minimal. But, it is open long enough to read and write a lot of characters (to the file buffer), minimizing the risk of the serial buffer overflowing (which is why you lose characters).