-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
  • 36,091
  • 7
  • 95
  • 123
mchouhan_google
  • 1,775
  • 1
  • 20
  • 28

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
  • 150,581
  • 18
  • 184
  • 329