Ignore:
Timestamp:
Sep 29, 2007, 9:26:35 PM (17 years ago)
Author:
OverTaker
Message:

GetFileSystemInfos実装完了。他ちょっとした修整

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Include/Classes/System/IO/DirectoryInfo.ab

    r333 r345  
    1010        OriginalPath = path
    1111        FullPath = Path.GetFullPath(path)
    12         Refresh()
    1312    End Sub
    1413
     
    160159        find = FindFirstFile(ToTCStr(Path.Combine(FullPath, searchPattern)), findData)
    161160        If find = INVALID_HANDLE_VALUE Then
    162             debug 'Exception
    163             Return Nothing
     161            Return New List<DirectoryInfo>
    164162        End If
    165163
    166164        Dim files As List<FileSystemInfo>
    167         Dim i = 0 As Long
    168165        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)))
    176171            End If
    177             i++
    178172        Loop While FindNextFile(find, findData)
    179173        FindClose(find)
     174
     175        files.Remove(New DirectoryInfo(Path.Combine(FullPath, ".")))
     176        files.Remove(New DirectoryInfo(Path.Combine(FullPath, "..")))
    180177
    181178        If GetLastError() = ERROR_NO_MORE_FILES Then
Note: See TracChangeset for help on using the changeset viewer.