linux程序打不开头文件
#include <fcnt1.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc,char *argv[])
{
int fd_open,fd_open_create,fd_create;
if((fd_open=open("/home/wang/test/hello.c",O_RDONLY))==-1)
{
perror("open");
exit(EXIT_FAILURE);
}
printf("the file's descriptor is:%d\n",fd_open);
if((fd_open_create==open("./tmp1",O_CREAT|O_EXCL,0644))==-1)
{
perrno("open");
exit(EXIT_FAILURE);
}
printf("the tmp1 file descriptor is:%d\n",fd_open_create);
if((fd_create=creat("./tem2",0644))==-1)
{
perrno("create");
exit(EXIT_FAILURE);
}
printf("the tmp2 file descriptor is:%d\n",fd_create);
close(fd_open);
close(fd_create);
close(fd_open_create);
return 0;
}
编译结果
wangjun@my-desktop:~/test$ gcc -ggdb3 -o open_example open_example.c
open_example.c:1:19: 错误: fcnt1.h:没有该文件或目录
open_example.c: 在函数‘main’中:
open_example.c:8:
相关问答:
C/C++ code:
char Time="2009-9-23";
FILE *fpOut=fopen("1.txt","w+");
if(fpOut==NULL)
return ;
fwr ......
写了个测试程序如下
struct hostent *hp;
char AlarmDevIP[20];
int x2;
hp = gethostbyname("www.google.com");
if (hp)
{
......
安装Mandrake9.0后,在命令行,如何进入桌面版?
Mandrake9.0有没有桌面版?
如果用linux桌面版,用哪个版本比较好?跪求下载地址
用UBUNTU吧 这个比较简单
http://distrowatch.com/
......
大家好,本人目前刚刚接触Linux。现在公司的项目需要缩减Linux的Kernel和APP部分的Code Size。目前我们使用的是Linux2.6.22.15版本,应用于ADSL Modem(家庭网关)。
1.我们产品应用是ADSL Gateway,Kernel部 ......
现在的做法是,通过crontab每分钟执行一个php,这个php负责从数据库中取出邮件,然后发送
问题是,如果邮件很多,每分钟执行不完,那会造成很多php进程
能不能实现等这个php执行完了立即启动一个新的?不用cr ......