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

DirectoryInfo.GetDirectoriesのバグ修整。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.