Changeset 333 for trunk/Include/Classes


Ignore:
Timestamp:
Sep 9, 2007, 2:21:07 PM (17 years ago)
Author:
OverTaker
Message:

DirectoryInfo.GetDirectoriesのバグ修整。

Location:
trunk/Include/Classes/System/IO
Files:
2 edited

Legend:

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

    r330 r333  
    105105                    subdirs = dirs[i].GetDirectories(searchPattern)
    106106                    For j = 0 To ELM(subdirs.Count)
    107                         dirs.Add(subdirs[i])
     107                        dirs.Add(subdirs[j])
    108108                    Next
    109109                Next
     
    136136            Case SearchOption.AllDirectories
    137137                Dim dirs As List<DirectoryInfo>
    138                 dirs = GetDirectories(searchPattern, SearchOption.AllDirectories)
     138                dirs = GetDirectories("?*", SearchOption.AllDirectories)
    139139
    140140                Dim files As List<FileInfo>
    141                 Dim subfiles As List<FileInfo>
    142                 Dim i As Long, j As Long
     141                files = GetFiles(searchPattern)
     142                Dim i As Long, j As Long, subfiles As List<FileInfo>
    143143                For i = 0 To ELM(dirs.Count)
    144144                    subfiles = dirs[i].GetFiles(searchPattern)
  • trunk/Include/Classes/System/IO/FileSystemInfo.ab

    r318 r333  
    4343    Sub CreationTime(ByRef value As DateTime)
    4444        m_CreationTime = value.ToFileTimeUtc()
    45         If setFileTime() = False Then
    46             'Exception
    47             debug
    48         End If
     45        setFileTime()
    4946    End Sub
    5047
    5148    Function CreationTimeUtc() As DateTime
    52         Dim date = CreationTime As DateTime
    53         Return date.ToUniversalTime()
     49        Return CreationTime.ToUniversalTime()
    5450    End Function
    5551
     
    6460    Sub LastAccessTime(ByRef value As DateTime)
    6561        m_LastAccessTime = value.ToFileTimeUtc()
    66         If setFileTime() = False Then
    67             'Exception
    68             debug
    69         End If
     62        setFileTime()
    7063    End Sub
    7164
    7265    Function LastAccessTimeUtc() As DateTime
    73         Dim date = LastAccessTime As DateTime
    74         Return date.ToUniversalTime()
     66        Return LastAccessTime.ToUniversalTime()
    7567    End Function
    7668
     
    8577    Sub LastWriteTime(ByRef value As DateTime)
    8678        m_LastWriteTime = value.ToFileTimeUtc()
    87         If setFileTime() = False Then
    88             'Exception
    89             debug
    90         End If
     79        setFileTime()
    9180    End Sub
    9281
    9382    Function LastWriteTimeUtc() As DateTime
    94         Dim date = LastWriteTime As DateTime
    95         Return date.ToUniversalTime()
     83        Return LastWriteTime.ToUniversalTime()
    9684    End Function
    9785
     
    138126        m_LastWriteTime = data.ftLastWriteTime
    139127    End Sub
    140 
    141128Private
    142     Function setFileTime() As Boolean
     129    Sub setFileTime()
    143130        Dim hFile = CreateFile(ToTCStr(FullPath), GENERIC_WRITE, FILE_SHARE_READ Or FILE_SHARE_WRITE, ByVal 0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0)
    144131        If hFile = INVALID_HANDLE_VALUE Then
    145             setFileTime = False
     132            debug 'Exception
    146133            Exit Function
    147134        End If
    148135
    149         If SetFileTime(hFile, m_CreationTime, m_LastAccessTime, m_LastWriteTime) Then
    150             setFileTime = True
    151         Else
    152             setFileTime = False
     136        If SetFileTime(hFile, m_CreationTime, m_LastAccessTime, m_LastWriteTime) = False Then
     137            debug 'Exception
    153138        End If
    154139
    155140        CloseHandle(hFile)
    156     End Function
     141    End Sub
    157142End Class
    158143
Note: See TracChangeset for help on using the changeset viewer.