This is the mail archive of the
guile@cygnus.com
mailing list for the Guile project.
Re: Getting a (FILE *) from a file descriptor
Seems a shame to waste a fd carelessly. How about
dup()
fclose()
dup2()
upon file close so that the fd is only wasted for a fraction of a
second.
Ken Raeburn wrote:
>
> Ian Grant <I.A.N.Grant@damtp.cam.ac.uk> writes:
>
> > Oops, it's fdopen isn't it? I was even staring at the man page. Sorry.
>
> Well, fdopen is okay, but calling fclose will result in the file
> descriptor being closed. A dup and fdopen would probably work more
> cleanly. (You are going to make sure the FILE* gets closed, right?)