For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > December 2004 > File * to fd









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author File * to fd
termbios

2004-12-22, 9:13 pm

I get a FILE * pointer by calling popen. Now I want to change it into a
file descriptor. Is there a function call for it? Like fdopen create a
FILE* out of a file descriptor.

Thanks,

termbios

Chris McDonald

2004-12-22, 9:13 pm

"termbios" <meson@techemail.com> writes:

>I get a FILE * pointer by calling popen. Now I want to change it into a
>file descriptor. Is there a function call for it? Like fdopen create a
>FILE* out of a file descriptor.



You probably want int fileno(FILE *);
but it doesn't really "change" the file pointer to a descriptor -
it provides the descriptor associated with the already open file pointer.

--
Chris.
moi

2004-12-22, 9:13 pm

fileno()


David Schwartz

2004-12-23, 4:11 am


"termbios" <meson@techemail.com> wrote in message
news:1103757841.418156.85480@f14g2000cwb.googlegroups.com...
>I get a FILE * pointer by calling popen. Now I want to change it into a
> file descriptor. Is there a function call for it? Like fdopen create a
> FILE* out of a file descriptor.


Google for 'fileno'.

DS


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com