-4

Is it possible to access file descriptor from file pointer in c ? If not then why ? I tried using fp->fd but i am getting compilation error:

File has no member named fd

what shall i do ?

Andreas Fester
  • 35,119
  • 7
  • 92
  • 115
mchouhan_google
  • 1,556
  • 1
  • 18
  • 26

1 Answers1

2

Under Linux and other Unices, there is a function fileno in <stdio.h> which should give you that information. Just be sure that you're compiling with the flags necessary to see this function.

James Kanze
  • 146,674
  • 16
  • 175
  • 326