开发者

c++ file descriptor (sockets) isopen()?

In C++, is there a way to check if a file开发者_StackOverflow社区 descriptor is still open, long after it was initially opened?


You can use fcntl with the F_GETFL to get if the fd is valid or not.


fstat is the most portable way I can think of.

If you tell us what platform, we may be able to suggest something better for your particular situation.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜