leute, ich brauche eure hilfe:
ich möchte mittels ExamineDirectory den Inhalt einer Verzeichnis auslesen und während dem Lese-Vorgang die einzelnen Einträge
im Statusbar anzeigen lassen.
Das Ganze läuft rekursiv ab und braucht bei komplexen Verzeichnisstrukturen entsprechend mehr Zeit. Also soll der Anwender
im Statusbar sehen können, das das Programm nicht eingefrohren ist, sondern eben die einzelnen Verzeichnisse bzw. Unterverzeichnisse durchläuft.
Hauptprozedur zum Zweck:
Code: Alles auswählen
Global NewList run_proc_dir.s()
Procedure check_sub_dirs( thisSrc.s, id.l )
If ExamineDirectory( id, thisSrc, "*.*" )
; ------------------------------------------------------- ;
StatusBarText( 0, 0, "Directory: " + thisSrc )
; ------------------------------------------------------- ;
While NextDirectoryEntry(id)
If DirectoryEntryType(id) = #PB_DirectoryEntry_Directory
f$ = DirectoryEntryName(id)
; ***
If f$ <> "." And f$ <> ".."
If Right( thisSrc, 1 ) <> #syschar
f$ = thisSrc + #syschar + f$
Else
f$ = thisSrc + f$
EndIf
; ***
AddElement( run_proc_dir() ) : run_proc_dir() = f$
; ***
; ------------------------------------------------------- ;
StatusBarText( 0, 0, "Sub-Directory: " + f$ )
; ------------------------------------------------------- ;
; ***
check_sub_dirs( f$, id + 1 )
EndIf
EndIf
Wend
; ***
FinishDirectory(id)
EndIf
EndProcedure
mfg
kurt