⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 my_create.c

📁 《LINUX C编程实战》(作者:童永清
💻 C
字号:
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>

int main()
{
	int fd;

	if ((fd = open("example_62.c", O_CREAT|O_EXCL, S_IRUSR| S_IWUSR)) == -1) {
	//if ((fd = creat("example_62.c", S_IRWXU)) == -1) {
		perror("open");
        //printf("open:%s    with errno:%d\n",strerror(errno),errno);
		exit(1);
	} else {
		printf("create file success\n");
	}
	
	close(fd);
	return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -