#include<stdio.h>
#include<sys/types.h>
#include<dirent.h>
#include<string.h>
#include <sys/stat.h>
#include<unistd.h>
#include<fcntl.h>
void find_picture(char *path)
{
DIR *dp = opendir(path);
if(dp==NULL){perror("");return;}
while(1)
{
struct dirent *msg = readdir(dp);
if(msg==NULL)break;
if(msg->d_name[0] == '.')continue;//隐藏文件
char picture_path[1024]={0};
if(msg->d_type==DT_REG)//普通文件
{
if(strstr(msg->d_name,".png")||strstr(msg->d_name,".jpg")||strstr(msg->d_name,".jpeg")||strstr(msg->d_name,".bmp"))
{
sprintf(picture_path,"%s/%s",path,msg->d_name);//拼接路径
puts(picture_path);
}
//
}
if(msg->d_type == DT_DIR)//目录
{