Re: virtual documents

neuss@igd.fhg.de
Wed, 7 Jul 93 18:28:47 +0200


Hello folx,

Ron D. Appel (appel@cih.hcuge.ch) writes:
> In several papers, I have read about virtual and real documents.
> How does one build (and send back to the client) a VIRTUAL DOCUMENT, for

> example as a result of an index search?

That can be done in quite a simple way.. the easiest way is to modify the
HTTP server so that it creates a temporary file, then calls up a routine

which handles the request and writes to that file, then sends and afterwards

deletes it.
Here's an excerpt from our Server:
..
tmpfile = (char *)tmpnam(NULL);
sprintf(buf,
"sh /LocalLibrary/httpd_index %s '%s' %s >/dev/null 2>/dev/null",
file,keybuf,tmpfile);
system(buf);
if(stat(tmpfile,&finfo) == 0)
{
sprintf(logbuf,"INDEXFILE = %s\n",tmpfile);
printl;
send_file(tmpfile,fd);
unlink(tmpfile);
}
..
This is a bit of a dirty hack, but it works just fine :-)

Hope that helps,
Chris
/*
* Christian Neuss % neuss@igd.fhg.de % ..in the humdrum
*/