7 static char pbuf[8192];
8 static const std::string lsCom(
"/bin/ls ");
10 std::vector<std::string> newfnames;
12 if ( ( fname.find(
'*', 0) != std::string::npos ) ||
13 ( fname.find(
'?', 0) != std::string::npos ) )
15 FILE* ftmp = popen((lsCom+fname).c_str(),
"r");
17 std::stringstream fnstream;
18 while ( fgets(pbuf, 8192, ftmp) != NULL ) {
23 while ( ! (fnstream>>tfn).eof() ) {
24 newfnames.push_back(tfn);
28 newfnames.push_back(fname);
36 static char pbuf[8192];
37 static const std::string lsCom(
"/bin/ls ");
39 std::vector<std::string> newfnames;
41 std::stringstream fnstream;
42 std::vector<std::string>::const_iterator it = fnames.begin();
44 while ( it != fnames.end() ) {
45 if ( ( it->find(
'*', 0) != std::string::npos ) ||
46 ( it->find(
'?', 0) != std::string::npos ) ) {
48 std::string com = lsCom + (*it);
49 FILE* ftmp = popen(com.c_str(),
"r");
52 while ( fgets(pbuf, 8192, ftmp) != NULL ) {
56 while ( ! (fnstream>>fname).eof() ) {
57 newfnames.push_back(fname);
61 newfnames.push_back(*it);
71 std::string::size_type pathend = fname.rfind(
'/', fname.length());
72 std::string idxname = (pathend != std::string::npos ) ? fname.substr(pathend+1) : fname;
81 std::stringstream sstr;
87 while ( str.length() < 3 ) {
88 str = std::string(
"0") + str;