#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h> #define MYFIFO "/tmp/myfifo" int main(int argc, char *argv[])
{
int fd;
char buf_w[]; fd=open(MYFIFO,O_WRONLY|O_NONBLOCK,);
if(fd==-)
{
printf("Open the FIFO is fail!\n");
if(errno==ENXIO)
printf("There is no Read FIFO!\n");
exit();
}
memset(buf_w,,sizeof(buf_w));
strcpy(buf_w,argv[]);
if(write(fd,buf_w,)<)
{
printf("Write data to FIFO fail!\n");
}
else
{
printf("Write data are: %s\n",buf_w);
} return ;
}
相关文章
- 闲扯 『 document.write 』
- Manual write code to record error log in .net by Global.asax
- FPGA Asynchronous FIFO设计思路(2)
- Write-output 帮助信息
- H2数据库General error: “The write format 1 is smaller than the supported format 2 [2.0.202/5]“
- FWFT FIFO的读写操作
- 数据加载与保存-通用方式 使用df.write.save方法保存数据,同样可通过format指定数据类型。 save方法后需传入保存路径(针对csv、orc、parquet、textFile格式)。 option方法用于设置特定格式的参数。 保存操作可使用SaveMode来指明如何处理数据,如覆盖(overwrite)、追加(append)等,通过mode方法设置。 特定格式保存 与加载类似,Parquet、JSON、CSV等格式均可通过指定format进行保存。 MySQL等关系型数据库的写入也通过JDBC实现,需指定format为jdbc,并传入数据库连接信息及表名。 注意事项
- NotWritableError: The current user does not have write permissions to a required path.解决方案
- open/read/write/close
- 页面置换算法C语言实现(FIFO,OPT,LRU)