is there a way can i get the file descriptor form gzFile in program C?
We can get 'fd' from File* like this:
FILE * file
file = fopen("myfile","rt");
int fd = fileno(file);
but now my i want get 'fd' from a var type of gzFile
gzFile gzfile = gzopen("myfile", "rt");
can i get 'fd' from gzfile ?
I don't think so, its hidden by the API.
However you could open a file using open()
then store away its result and pass it to gzdopen()
to get a gzFile
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With