[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-enscript] enscript and temp file location
From: |
Tapani Tarvainen |
Subject: |
Re: [bug-enscript] enscript and temp file location |
Date: |
Wed, 12 Nov 2008 19:45:39 +0200 |
User-agent: |
Mutt/1.5.17+20080114 (2008-01-14) |
> On Wed, Apr 30, 2008 at 9:26 AM, Giulio Orsero <address@hidden> wrote:
>
> > On Fri, Apr 25, 2008 at 11:36 PM, Shawn McMahon <address@hidden>
> > wrote:
> >
> > > Why wouldn't we just use the simpler example:
> > >
> > > char *filename;
> > > int fd;
> > >
> > > do {
> > > filename = tempnam (NULL, "foo");
> > > fd = open (filename, O_CREAT | O_EXCL | O_TRUNC | O_RDWR, 0600);
> > > free (filename);
> > > } while (fd == -1);
> >
> > I'm not a C programmer, could you tell me how I switch from
> >
> > static FILE *divertfp = NULL;
> > divertfp = tmpfile ();
> > to your example?
> >
> > I can substitute the current instruction with the new ones, but then
> > how I convert from "int something" to "FILE *something"
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.
--
Tapani Tarvainen