The fopen function returns a pointer to a FILE structure,
fopen
FILE
On Linux, there's the int fileno(FILE *); function that returns the file descriptor (the one that was returned by the low-level open function) from the FILE*.
int fileno(FILE *);
open
FILE*
I don't know if it applies to Windows and returns the HANDLE though?