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

📄 file-write.c

📁 一个Windows下的Linux专用虚拟机
💻 C
字号:
/* * This source code is a part of coLinux source package. * * Henry Nestler, 2007 (c) * * The code is licensed under the GPL. See the COPYING file at * the root directory. * */#include <sys/stat.h>#include <fcntl.h>#include <unistd.h>#include <colinux/os/user/file.h>co_rc_t co_os_file_write(co_pathname_t pathname, void *buf, unsigned long size){	int fd, wr;	fd = open((char *)pathname, O_WRONLY | O_CREAT | O_TRUNC,		    S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);	if (fd == -1)		return CO_RC(ERROR);	wr = write(fd, buf, size);	close(fd);	if (wr != size)		return CO_RC(ERROR);	return CO_RC(OK);}

⌨️ 快捷键说明

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