Autor Beitrag
Natti
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 50



BeitragVerfasst: Mi 01.02.06 11:57 
Ich habe folgendes Problem:
in einem bestimmten Verzeichnis befinden sich mehrere Unterverzeichnisse.
Ich möchte nur die Verzeichnisse auflisten, dessen Name mit z.B. "A_" anfängt.
Wie kann ich das tun? Mit DirectoryExists funktioniert es ohne weiteres nicht.


Moderiert von user profile iconraziel: Topic aus Programmierwerkzeuge verschoben am Mi 01.02.2006 um 11:33
digi_c
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1905

W98, XP
D7 PE, Lazarus, WinAVR
BeitragVerfasst: Mi 01.02.06 13:34 
Da wird dir sicherlich FindFirst, Findnext ... helfen.
Natti Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 50



BeitragVerfasst: Mi 01.02.06 17:20 
Sind diese Funktionen nicht nur für die Dateien?
Die Dateien interessieren mich nicht.
Ich möchte nur alle Unterverzeichnisse von einem Verzeichnis sehen, die z.B. mit "A" anfangen
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8548
Erhaltene Danke: 477

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Mi 01.02.06 17:48 
Das müsste in etwa so gehen:
ausblenden Delphi-Quelltext
1:
2:
3:
if findfirst(MeinParentOrdner + '\A*', FaDirectory, MeinSearchRec)=0 then 
// evtl. ohne das "\", je nachdem, ob "MeinParentOrdner" das enthält oder nicht
  Showmessage('Ordner mit A gefunden');

_________________
We are, we were and will not be.
digi_c
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1905

W98, XP
D7 PE, Lazarus, WinAVR
BeitragVerfasst: Mi 01.02.06 20:35 
Nein WIN nimmt es nicht soooo genau mit einer klaren Trennung von Dateien und Verzeichnissen :-)