Ignore:
Timestamp:
Feb 17, 2008, 12:51:20 PM (16 years ago)
Author:
OverTaker
Message:

System/IO/Directory.ab実装。例外処理を徐々に実装。

File:
1 edited

Legend:

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

    r406 r407  
    245245    Virtual Sub Delete()
    246246        If DeleteFile(ToTCStr(FullPath)) = FALSE Then
    247             Throw 'Exception
     247            Throw New IOException("DriveInfo.Delete: Failed to DeleteFile.")
    248248        End If
    249249    End Sub
     
    258258        FindClose(hFind)
    259259
    260         m_FileAttributes = New FileAttributes(data.dwFileAttributes As Long, "FileAttributes")
    261         m_CreationTime = data.ftCreationTime
    262         m_LastAccessTime = data.ftLastAccessTime
    263         m_LastWriteTime = data.ftLastWriteTime
    264 
    265         m_IsFreshed = True
     260        If hFind <> INVALID_HANDLE_VALUE Then
     261            m_FileAttributes = New FileAttributes(data.dwFileAttributes As Long, "FileAttributes")
     262            m_CreationTime = data.ftCreationTime
     263            m_LastAccessTime = data.ftLastAccessTime
     264            m_LastWriteTime = data.ftLastWriteTime
     265            m_IsFreshed = True
     266        Else
     267            Throw New IOException("DriveInfo.Refresh: Failed to FindFirstFile.")
     268        End If
    266269    End Sub
    267270
     
    280283        Dim hFile = CreateFile(ToTCStr(FullPath), GENERIC_WRITE, FILE_SHARE_READ Or FILE_SHARE_WRITE, ByVal 0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0)
    281284        If hFile = INVALID_HANDLE_VALUE Then
    282             debug 'Exception
     285            Throw New IOException("DriveInfo.setFileTime: Failed to CreateFile.")
    283286            Exit Function
    284287        End If
    285288
    286289        If SetFileTime(hFile, m_CreationTime, m_LastAccessTime, m_LastWriteTime) = False Then
    287             debug 'Exception
     290            Throw New IOException("DriveInfo.setFileTime: Failed to SetFileTime.")
    288291        End If
    289292
Note: See TracChangeset for help on using the changeset viewer.