On Wed, Nov 12, 2008 at 6:45 PM, Tapani Tarvainen
<address@hidden> wrote:
Unless I'm missing something here, all that's needed is
static FILE *divertfp;
in the beginning and
divertftp = fdopen(fd,"w+b");
after the while loop.
I've got one last problem.
I need to add something to get the temp file deleted after its use.
I think I need to do something in undivert()
undivert() {
.....
fclose (divertfp);
divertfp = NULL;
cofp = ofp;
}
I don't know what to do and whether it's safe to delete the file unconditionally here.
Thanks.