Sub SdCard(CurPath As String)
Dim FileList, FolderList As List
Dim F As String
FileList.Initialize
FolderList.Initialize
If CurPath = "" Then
CurPath = "/mnt/sdcard"
End If
If File.IsDirectory(CurPath,"") Then
Try
FileList = File.ListFiles(CurPath)
If FileList.IsInitialized Then
If FileList.Size > 0 Then
F = CurPath
Listview1.AddSingleLine(F)
CodeModule.ViewList.Add(F)
For i = 0 To FileList.Size - 1
F = FileList.Get(i)
If File.IsDirectory(CurPath & "/" & F,"")Then
FolderList.Add(CurPath & "/" & F)
Else
Listview1.AddSingleLine(CurPath & "/" & F)
CodeModule.ViewList.Add(CurPath & "/" & F)
Counter = Counter + 1
LabelCounter.Text = Counter
End If
DoEvents
Next
End If
End If
Catch
Msgbox(LastException & " " & CurPath & " " & FileList.Size,"File")
End Try
'Recursive Code
Try
If FolderList.IsInitialized Then
If FolderList.Size > 0 Then
For i = 0 To FolderList.Size - 1
F = FolderList.Get(i)
SdCard(F)
DoEvents
Next
End If
End If
Catch
Msgbox(LastException & " " & FolderList.Size & " " & F,"Folder")
End Try
End If
End Sub