Unix Programming - File * to fd

This is Interesting: Free IT 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, 5:54 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, 5:54 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, 8:54 pm

fileno()


David Schwartz

2004-12-22, 8:54 pm


"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






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com