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:
相关问答:
目标:当网络中有数据到达或者超时,程序进入下一次循环。
问题:select()函数不起作用,程序不会在select的地方阻塞一秒,并且当网络上有数据的时候,select的返回值仍然小于0
#include <s ......
192.168.0.201是Linux
192.168.0.35是另外一台装有WEB的服务器,
我想访问192.168.0.201的时候
让他nat到192.168.0.35的80上。
以下是我设置的,但是不行。应该怎么设置呀?
root@ubuntu:/h ......
我没有安装操作系统的经验,即使是WINDOWS。现在想在LINUX操作系统大环境下学C语言,又要买本本,请问如果操作系统安装不当,会不会对电脑造成什么大的破坏?有没有必要先买一个二手电脑练一下LINUX的 ......
mysqladmin -u root drop 数据库名
这样删除会要求按y 确定
有没有参数加在后面 让我不用按y确认也可以删除
mysql -u root -e "drop databse 数据库名"
SQL code:
mysql> drop datab ......