I need to get a directory listing into a string format, or into an array either way, preferrably into a string format.
I have two methods I am trying.
The first is DIR$, but it returns the same file over and over again.
The file is "C:\TEMP\*.*" and this is the contents of it and almost as I want to display it to the FTP Client:
-------------
Scott
mailto:[email protected][email protected]</A>
I have two methods I am trying.
The first is DIR$, but it returns the same file over and over again.
The file is "C:\TEMP\*.*" and this is the contents of it and almost as I want to display it to the FTP Client:
Code:
Volume in drive C is TNG98 Volume Serial Number is <not shown> Directory of C:\TEMP . <DIR> 03-27-00 10:13p . .. <DIR> 03-27-00 10:13p .. DIR TXT 990 03-27-00 10:13p DIR.TXT DIR2 TXT 2,097 03-27-00 11:25p dir2.txt 2 file(s) 3,087 bytes 2 dir(s) 2,108.52 MB free OK The first part returns the same filename 5 times, the second part re turns null. The first part is commented out as I tested part #2.. '============================================================================== Function GetDirList(CurrentDir As String) Export As String Local hDir As Long Local FindData As WIN32_FIND_DATA Local f As Asciiz * 256 Local x As Long Local bytes As Long Local sTmp As String Local St As String %DIR_LENGTH = 5 'For x = 1 To %DIR_LENGTH ' sTmp = Dir$(CurrentDir + "\*.*") ' If Len(sTmp) = 0 Then ' Exit For ' Else ' St = St + sTmp + $CRLF ' End If 'Next For x = 1 To %DIR_LENGTH FindData.dwFileAttributes = %FILE_ATTRIBUTE_NORMAL f = CurrentDir + "\*.*" hDir = FindFirstFile(f, FindData) If hDir = %INVALID_HANDLE_VALUE Then Exit For Else bytes = bytes + FindData.nFileSizeLow sTmp = Left$(FindData.cFilename,12) + Format$(FindData.nFileSizeLow,"###,###,###") + " " + FileDateTime(FindData) + " " + Trim$(Str$(bytes)) If Len(St) Then St = sTmp + $CRLF Else Exit For End If Next Function = St End Function
-------------
Scott
mailto:[email protected][email protected]</A>
Comment