Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

C Verzeichnisse und Unterverzeichnisse auslesen mit WinAPI

Empfohlene Antworten

Veröffentlicht

Hallo,

ich habe ein Problem und zwar Versuche ich verzweifelt alle Unterverzeichnisse auszulesen aber es will einfach nicht klappen...

Ich möchte nach allen Mp3 Dateien die auf dieser Festplatte sind suchen und danach mit ihnen etwas machen (id3tag).

Meine Funktion zum Auslesen sieht bis jetzt so aus:



void SearchFiles(CString szPath)

{

    HANDLE hFile;

    CString szSubDir;

    CString szCreateSearchString;

    // Create the Base Search Directory for the Mp3 Files

    szCreateSearchString = szCreateSearchString + szPath + "*.mp3";



    hFile = FindFirstFile(szCreateSearchString,&wfd);

    do

    {

        if (!((wfd.cFileName[0] == '.') && ((wfd.cFileName[1] == '.' && wfd.cFileName[2] == 0) || wfd.cFileName[1] == 0)))

        {

            //Verzeichnisse

            if (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)

            {

                szSubDir = szSubDir + szPath + wfd.cFileName;

                SearchFiles(szSubDir);

                printf(" %s", szSubDir);


            }

            //Dateien

            else

            {

                 CString szFile;                                

                szFile = szPath;

                szFile = szFile + wfd.cFileName;               

                readMp3(szFile);    

             }

        }

    }while (FindNextFile(hFile,&wfd));

    FindClose(hFile);

}

Waehre nett wenn sich das jemand mal kurz anschauen könnte.

Vielen Dank.

So findest du natürlich nur die Unterverzeichnisse, die auf .mp3 enden.

Kannst du mir vielleicht sagen wo genau der Fehler liegt, ich schau es mir die ganze Zeit an und Probiere aber ich finde ihn nicht.

Danke

Vorsicht mit wfd. Auf jeden Fall sollte das mit in die Funktion, sonst kann es böse Fallen bei der Rekursion geben.

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.