Check file size before checking content

This might also mitigate the "file in use" problem but might require more memory