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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Thanks
If you want to map a FILE* to an integer file descriptor
you gotta use fileno()
ASKER
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