开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜