Buchempfehlung
Mikrocomputertechnik mit Controllern der Atmel AVR-RISC-Familie
Mikrocomputertechnik mit Controllern der Atmel AVR-RISC-Familie
Umfassend, aber leicht verständlich führt dieses Buch in die Programmierung von ATMEL AVR Mikrocontrollern ein. [Mehr Infos...]
FreeBASIC-Chat
Es sind Benutzer im FreeBASIC-Chat online.
(Stand:  )
FreeBASIC bei Twitter
Twitter FreeBASIC-Nachrichten jetzt auch über Twitter erhalten. Follow us!

fb:porticula NoPaste

Info
Info / Hilfe
Liste
Übersicht / Liste
Neu
Datei hochladen
Suche
Quellcode suchen
Download
Dateidownload

Ordnerinhalte auflisten (Open Pipe)

Uploader:Mitgliedhhr
Datum/Zeit:04.07.2019 11:30:03

'Anstelle von Command(1) kann ein Ordnerpfad eingetragen werden.
Dim As String path = Command(1)
Dim As String afolder(), afile()
Redim aFolder(0)
Redim aFile(0)

Open Pipe "DIR /A:D /B /S " & Chr(34) & path & Chr(34) For Input As #1
Do Until Eof(1)
   Redim Preserve aFolder(Ubound(aFolder) + 1)
   Line Input #1, aFolder(Ubound(aFolder))
Loop
Close #1

Open Pipe "DIR /A:-D /B /S " & Chr(34) & path & Chr(34) For Input As #1
Do Until Eof(1)
   Redim Preserve aFile(Ubound(aFile) + 1)
   Line Input #1, aFile(Ubound(aFile))
Loop
Close #1

Print path
Print "Files:"; Ubound(afile)
Print "Folders:"; Ubound(afolder)
Print "-- More --" : Sleep
Dim As Ulong i
For i = 1 To Ubound(afolder)
   Print i; " Folder: "; afolder(i)
Next i
For i = 1 To Ubound(afile)
   Print i; " File: "; afile(i)
Next i
Sleep
End
'