日期:2014-05-16 浏览次数:20639 次
void run()
{
int fd2;
char buffer[10] = {0},storeRout[50] = {0};
printf("thread.........write........fun4\n");
strcat(storeRout, StoreRoute);
strcat(storeRout, "2.txt");
//printf(".................storeRout = %s\n", storeRout);
fd2 = open(storeRout, O_CREAT|O_RDWR|O_EXCL, 0777);
if(0 > fd2)
{
if(EEXIST == errno)
{
fd2 = open(storeRout, O_RDWR);
if(-1 == fd2)
{
perror("fd2....1.....open");
exit(-1);
}
}
else
{
perror("fd2....2....open");
exit(-1);
}
}
while(1)
{
write(fd2, buffer, writeBuf);
}
}