词条 | creatnew |
释义 | 函数名: creatnew 功 能: 创建一个新文件 用 法: int creatnew(const char *filename, int attrib); 程序例: #include <string.h> #include <stdio.h> #include <errno.h> #include <dos.h> #include <io.h> int main(void) { int handle; char buf[11] = "0123456789"; /* attempt to create a file that doesn't already exist */ handle = creatnew("DUMMY.FIL", 0); if (handle == -1) printf("DUMMY.FIL already exists.\"); else { printf("DUMMY.FIL successfully created.\"); write(handle, buf, strlen(buf)); close(handle); } return 0; } |
随便看 |
百科全书收录4421916条中文百科知识,基本涵盖了大多数领域的百科知识,是一部内容开放、自由的电子版百科全书。