Changeset 345 for trunk/Include/Classes/System/IO/DirectoryInfo.ab
- Timestamp:
- Sep 29, 2007, 9:26:35 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Include/Classes/System/IO/DirectoryInfo.ab
r333 r345 10 10 OriginalPath = path 11 11 FullPath = Path.GetFullPath(path) 12 Refresh()13 12 End Sub 14 13 … … 160 159 find = FindFirstFile(ToTCStr(Path.Combine(FullPath, searchPattern)), findData) 161 160 If find = INVALID_HANDLE_VALUE Then 162 debug 'Exception 163 Return Nothing 161 Return New List<DirectoryInfo> 164 162 End If 165 163 166 164 Dim files As List<FileSystemInfo> 167 Dim i = 0 As Long168 165 Do 169 If i > 1 Then 170 Dim s = New String(findData.cFileName As PCTSTR) 171 If (findData.dwFileAttributes And FILE_ATTRIBUTE_DIRECTORY) = FILE_ATTRIBUTE_DIRECTORY Then 172 files.Add(New DirectoryInfo(Path.Combine(FullPath, s))) 173 Else 174 files.Add(New FileInfo(Path.Combine(FullPath, s))) 175 End If 166 Dim s = New String(findData.cFileName As PCTSTR) 167 If (findData.dwFileAttributes And FILE_ATTRIBUTE_DIRECTORY) = FILE_ATTRIBUTE_DIRECTORY Then 168 files.Add(New DirectoryInfo(Path.Combine(FullPath, s))) 169 Else 170 files.Add(New FileInfo(Path.Combine(FullPath, s))) 176 171 End If 177 i++178 172 Loop While FindNextFile(find, findData) 179 173 FindClose(find) 174 175 files.Remove(New DirectoryInfo(Path.Combine(FullPath, "."))) 176 files.Remove(New DirectoryInfo(Path.Combine(FullPath, ".."))) 180 177 181 178 If GetLastError() = ERROR_NO_MORE_FILES Then
Note:
See TracChangeset
for help on using the changeset viewer.