词条 | creatnew |
释义 | § 函数名 creatnew § 功能 创建一个新文件 § 用法 int creatnew(const char *filename, int attrib); § 程序例 #include #include #include #include #include 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; } |
随便看 |
百科全书收录594082条中文百科知识,基本涵盖了大多数领域的百科知识,是一部内容开放、自由的电子版百科全书。