易截截图软件、单文件、免安装、纯绿色、仅160KB

Linux FIFO代码问题 - Linux/Unix社区 / 程序开发区

/*speak.c*/
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#define FIFO_NAME "american_maid"
int main(void)
{
char s[300];
int num, fd;
mknod(FIFO_NAME, S_IFIFO | 0666, 0);
printf("waiting for readers...\n");
fd = open(FIFO_NAME, O_WRONLY);
printf("got a reader--type some stuff\n");
while (gets(s), !feof(stdin)) {
if ((num = write(fd, s, strlen(s))) == -1)
perror("write");
else
printf("speak: wrote %d bytes\n", num);
}
return 0;
}

/*tick.c*/
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#define FIFO_NAME "american_maid"
int main(void)
{
char s[300];
int num, fd;
mknod(FIFO_NAME, S_IFIFO | 0666, 0);
printf("waiting for writers...\n");
fd = open(FIFO_NAME, O_RDONLY);
printf("got a writer\n");
do {
if ((num = read(fd, s, 300)) == -1)
perror("read");
else {
s[num] = '\0';
printf("tick: read %d bytes: \"%s\"\n&


相关问答:

linux命令大全 - Linux/Unix社区 / UNIX文化

咨询QQ:269562808
bzip2recover
功能说明:用来修复损坏的.bz2文件。
语法:bzip2recover[.bz2压缩文件]
补充说明:bzip2是以区块的方式来压缩文件,每个区块视为独立的单位。因此,当某一区
块损坏时,便可利 ......

linux不能访问access - Java / Java EE

rt,我试了网上直连Acces数据库的方法,windows下没有问题,但是在linux下不行,谁能给点提示?谢谢
你怎么连的?

Acces数据库..
你怎么练的呢?

Java code:

static String DBDRIVER = "sun.jd ......

linux小问题 - Linux/Unix社区 / 程序开发区

tomcat自动重启脚本:
ps -ef | grep tomcat | grep -v grep | sed 's/ [ ]*/:/g' | cut -d: -f3 | kill -9 
./startup
请问上面的脚本能不能帮我解释下,谢谢

学习~

你的意思不是太明白,是想自己写 ......

linux命令 - Linux/Unix社区 / 实用资料发布区

有谁有linux命令的缩写与全写的对照,比如cd--[change directory],最好命令能分类!
linux 命令大全
http://net.pku.edu.cn/~course/cs101/2008/resource/linux_command_tutorial.pdf

这里也有
http://www.ve ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号