** Start of listing of h1.cc ** #include #include #include main() { time_t t; struct tm* ptm; char* sTime; int slen; char* ip; char* path; std::cout << "Content-type: text/plain\n\n"; t = time(NULL); ptm = localtime(&t); sTime = asctime(ptm); slen = strlen(sTime); sTime[slen-1] = sTime[slen]; /* Copy null byte to clobber newline. */ slen = strlen(sTime); std::cout << "The time is " << sTime << " in California.\n\n"; ip = getenv("REMOTE_ADDR"); std::cout << "The IP number " << ip; std::cout << " is where your client/browser is located.\n\n"; path = getenv("PATH"); std::cout << "The PATH is " << path << " currently\n"; std::cout<<"(the only environment variable common to both CGI and login)\n"; } ** End of listing of h1.cc ** Here is the directory entry for that source file: -rw------- 1 rem user 746 Jun 28 2005 h1.cc ^ Note user execute permission *not* needed for source files. That gets compiled to a.out, but then renamed to something.cgi so that it will be usable by remote users via CGI: -rwx------ 1 rem user 5780 Jun 28 2005 h1-c++.cgi ^ Note user execute permission needed for all CGI programs. (because compiled C++ is native machine code run directly on machine)