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

📄 ch05-trymkdir.c

📁 linux编程精髓 源代码
💻 C
字号:
/* ch05-trymkdir.c --- Demonstrate mkdir() behavior.			Courtesy of Nelson H.F. Beebe. */#include <stdio.h>#include <stdlib.h>#include <errno.h>#if !defined(EXIT_SUCCESS)#define EXIT_SUCCESS 0#endifvoid do_test(const char *path){	int retcode;	errno = 0;	retcode = mkdir(path, 0755);	printf("mkdir(\"%s\") returns %d: errno = %d [%s]\n",		 path, retcode, errno, strerror(errno));}int main(void){	do_test("/tmp/t1/t2/t3/t4");	do_test("/tmp/t1/t2/t3");	do_test("/tmp/t1/t2");	do_test("/tmp/t1");	do_test("/tmp/u1");	do_test("/tmp/u1/u2");	do_test("/tmp/u1/u2/u3");	do_test("/tmp/u1/u2/u3/u4");	do_test("/tmp/v1/");	do_test("/tmp/v1/v2/");	do_test("/tmp/v1/v2/v3/");	do_test("/tmp/v1/v2/v3/v4/");	return (EXIT_SUCCESS);}

⌨️ 快捷键说明

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