#include
#include
#include
#include
#include
#include
#include
#include
#include
#define PATH "/media/work/test"
int main(int argc, char **argv)
{
DIR *pDir = opendir(PATH);
if (pDir == NULL)
{
perror("opendir failed.\n");
}
struct dirent *pDirent;
std::string picture("test.cpp");
std::string str;
while((pDirent = readdir(pDir)) != NULL)
{
//printf("name: %s\n", pDirent->d_name);
str = pDirent->d_name;
if (str.find(picture) != str.npos)
{
std::cout<
break;
}
}
struct stat buf;
if (stat(str.c_str(), &buf) == -1)
{
perror("stat failed.\n");
}
std::cout<< "size: "<
std::cout<< "st_mtime: "<
return 0;
}