unify file functions with std::
Possibly prevented a bug