Click on makefilelist.cpp to get source.
#include <iostream>
#include <string>

using namespace std;

int main(int argc, char *argv[])
{basic_string<char> line;
 basic_string<char> html("html");

 cout << "<html>" << endl;
 cout << "<h2>Directory listing</h2>" << endl;
 while(!cin.eof())
   {
    getline(cin, line);
    string::size_type found = line.find(html);
    if(found != string::npos)
      cout << "<a href=\"" << line << "\">"
           << line << "</a><br>" << endl;
   }
 cout << "</html>" << endl;
 return 0;
}