c - 确定流是否已满缓冲

标签 c linux unix

我知道 __flbf 函数可以告诉我一个流在 Linux 中是否是行缓冲的,但是如何确定一个流是否是全缓冲的?

最佳答案

您不能结合使用 __flbf__fbufsize 来查看文件是无缓冲的、行缓冲的还是 block 缓冲的?

喜欢

if (__flbf(some_file))
    printf("File is line buffered\n");
else if (__fbufsize(some_file) == 0)
    printf("File is unbuffered\n");
else
    printf("File is block (aka fully) buffered\n");

关于c - 确定流是否已满缓冲,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19651029/

相关文章:

c - 在 Opencv 中使用 IPL_DEPTH_32f

c - 有没有办法在 C 中传递这样的字符串?

linux - 需要在 bash shell linux 中比较当前时间

c++ - 调用 execl 时找不到 Grep

python - UNIX 上的 CPU 利用率

python - SimpleITK.Show() 在 Linux 上的 ImageJ 中生成错误

c - 什么 child 不从其 parent 那里继承信号量调整(semop(2))是什么意思?

c - 使用libxls在C中读取excel文件

c++ - 这个声明是什么意思 "int(*ptr[3])();"?

python - 为什么我的 Python 脚本编写的是 Windows 风格的回车符?