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

📄 _find.h

📁 Unix shell是unix的命令解释程序
💻 H
字号:
#include<sys/types.h>#include<dirent.h>#include<unistd.h>#include<stdio.h>void _find(char *str1,char *str2){//	if(isdir(str1)==0&&isfile(str1)==0)//		printf("%s is not a file or file directory!/n",str1);//	if(isdir(str1)==1)//	{		if(strcmp(str2,"")!=0)		{			int flag=0;			char *childdir;			DIR *dp;			struct dirent *dirp;			dp = opendir(str1);			while((dirp=readdir(dp))!=NULL)			{				if(strcmp(str2,dirp->d_name)==0)				{					printf("File %s is in the %s\n",str2,str1);					flag=1;				}			}			if(flag==0)				printf("File %s is not found\n",str2);		}//	}//	if(isfile(str1)==1)//	{		if(strcmp(str2,"")==0)		{			char buf[80];			getcwd(buf,sizeof(buf));			int flag=0;			char *childdir;			DIR *dp;			struct dirent *dirp;			dp = opendir(buf);			while((dirp = readdir(dp))!=NULL)			{				if(strcmp(str1,dirp->d_name)==0)				{					printf("File %s is in the %s\n",str1,buf);					flag=1;				}			}			if(flag==0)				printf("File %s is not found\n",str1);		}//	}}

⌨️ 快捷键说明

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