开发者

On Mac OS X, how do I turn a POSIX fd into a FILE*?

开发者 https://www.devze.com 2023-03-15 18:27 出处:网络
I\'m working with a lexer that accepts FILE* objects to read data from. I\'d like to be able to pass it POSIX 开发者_开发知识库file descriptors (i.e. stuff you get from open, pipes, etc.).

I'm working with a lexer that accepts FILE* objects to read data from. I'd like to be able to pass it POSIX 开发者_开发知识库file descriptors (i.e. stuff you get from open, pipes, etc.).

How can I turn a POSIX file descriptor into a FILE*?


On any POSIX-compliant system, you use fdopen().


Use fdopen(3) in <stdio.h>.

0

精彩评论

暂无评论...
验证码 换一张
取 消