Wie man die Datei Mal in C++

ich habe ein problem bei der Datei Zeitpunkt der Erstellung.. könnte jemand wissen, wie man die DATEI??

Bekam ich einen code, der bekommt den Dateinamen von einem bestimmten Verzeichnis mein problem ist, ich weiß nicht, wie man die filetimes auf jede Datei in dem Verzeichnis...

hier ist mein code:

#include <vector>
#include <string>
#include <windows.h>
#include <stdio.h>
#include <iostream> 
#include <conio.h>
#include <sys\types.h>
#include <sys\stat.h>
#include <time.h>
#include <exception>
#include <WinBase.h>

        using namespace std;
int ifException(string directory) throw()
    {
        DWORD returnvalue;
        returnvalue = GetFileAttributes(directory.c_str());
            if(returnvalue == ((DWORD)-1))
            {
                return 0;
            }
            else
            {   
                return 1;
            }
}



    vector <string> GetPath(string path)
    {



            char directory[9999];
            vector <string> filelist;
            string buffer;
            strcpy_s(directory,path.c_str());
            BOOL checker;




                try
                    {
                        ifException(directory);

                    }catch(int i)
                    {   
                        if (i==0)
                        {
                            _getch();
                            exit(1);
                        }
                    }
                buffer = findFileData.cFileName;
                filelist.push_back(buffer);
                checker = FindNextFile(hFind, &findFileData);
                while(checker)
                {
                    if(checker == 0)
                    {
                        filelist.resize(filelist.size());
                        return filelist;
                    }
                    checker = FindNextFile(hFind, &findFileData);
                    buffer = findFileData.cFileName;
                    filelist.push_back(buffer);;//save file list in vector
                }
                return filelist;
    }

    int main()
    {
       string path;

       path="C:\\Documents and Settings\\OJT\\My Documents\\game\\FSNPC\\*.*";//the directory
       vector <string> handler;
       handler = GetPath(path);
        for (unsigned i=1;i<handler.size()-1;i++)
        {
            cout << handler[i]<<endl;//print out the vector
        }
       _getch();
    }
auf welcher Plattform bist du?
windows-Plattform

InformationsquelleAutor Andro Miguel M. Bondoc | 2011-03-03

Schreibe einen Kommentar