+ function to check if file was open correctly