#include <iostream>
#include <dirent.h>
using namespace std;
int main(int argc, char *argv[]) {
DIR *dp;
struct dirent *drp;
if (argc != 2)
cout << "缺少参数" << endl;
if ((dp = opendir(argv[1])) == NULL) {
cout << "无法打开 " << argv[1] << endl;
return 1;
}
while ((drp = readdir(dp)) != NULL)
cout << drp->d_name << endl;
return 0;
}