check FILE flags for reads and writes