FileIOPlugin: Treat empty files as missing data

Also move into a helper function because it is needed in a later patch.