c++ file operation wrapper