Replace file_*_contents for foperations
Fix wrong mode when reading