Link to home
Start Free TrialLog in
Avatar of Ghostrider
Ghostrider

asked on

Converting int file descriptor to (file *) struct

Hi,

I'm really confused as to the mapping of integer file dscriptors, such as 0,1,2 (stdout and stderr) to (file *) structure on UNIX (specifically AIX), does anyone know how this is done?

Cheers

Andy
ASKER CERTIFIED SOLUTION
Avatar of rdelfino
rdelfino

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Ghostrider
Ghostrider

ASKER

kewl,

I actually wanted to map from the file struct to the integer index, but I've dealt with it, and at the expense of efficiency my code'll do!

I must remember fdopen!

Many thanks cheers

Andy

Thanks

If you want to map a FILE* to an integer file descriptor
you gotta use fileno()