// Copyright 2005 Daniel Cer (daniel.cer@cs.colorado.edu) // // This work is licensed under the Creative Commons Attribution-NonCommercial- // ShareAlike License. To view a copy of this license, visit // http://creativecommons.org/licenses/by-nc-sa/2.5/ or send a letter to // Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, // 94105, USA. #include #include #include // POSIX compatible #include // strerror using namespace std; bool list_directory(const string &dir_path) { DIR *dir_h; if ((dir_h = opendir(dir_path.c_str())) == NULL) return false; cout<<"Contents of \""<d_name<