int record_selection(const App& app, const string& history_file) { ofstream ofile(history_file, ofstream::app); if (!ofile) return FILE_OPEN_FAILURE; ofile << app.app_id() << std::endl; ofile.close(); trim_history(history_file); return 0; }