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 ) { fnstream << pbuf; }
21 while ( !( fnstream >> tfn ).eof() ) { newfnames.push_back( tfn ); }
23 else { newfnames.push_back( fname ); }
30 static char pbuf[8192];
31 static const std::string lsCom(
"/bin/ls " );
33 std::vector<std::string> newfnames;
35 std::stringstream fnstream;
36 std::vector<std::string>::const_iterator it = fnames.begin();
38 while ( it != fnames.end() )
40 if ( ( it->find(
'*', 0 ) != std::string::npos ) ||
41 ( it->find(
'?', 0 ) != std::string::npos ) )
44 std::string com = lsCom + ( *it );
45 FILE* ftmp = popen( com.c_str(),
"r" );
48 while ( fgets( pbuf, 8192, ftmp ) != NULL ) { fnstream << pbuf; }
50 while ( !( fnstream >> fname ).eof() ) { newfnames.push_back( fname ); }
52 else { newfnames.push_back( *it ); }