I tried adding a section to your attached code to have it write to a file if the object wasn't named control.empeg. I added this segment:
        if(strcmp(name, "control.empeg") == 0)

empeg_command(body);
else {
strcpy(filename, "/tmp/");
strcat(filename, name);
printf("Write it to a file.\n");
if(tempfd = open(filename, O_WRONLY) > 0 ) {
printf("Writing to '%s' (%d)\n", filename, tempfd);
write(tempfd, body, strlen(body));
close(tempfd);
}
}

but I'm obviously doing something wrong... the call to open() returns an fd of 1 so I write to stdout instead of the file. Can you see what I did wrong?
_________________________
--The Amigo