Changeset 407 for trunk/Include/Classes/System/IO/DirectoryInfo.ab
- Timestamp:
- Feb 17, 2008, 12:51:20 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Include/Classes/System/IO/DirectoryInfo.ab
r406 r407 55 55 */ 56 56 Sub Create() 57 CreateDirectory(ToTCStr(FullPath), NULL) 57 If CreateDirectory(ToTCStr(FullPath), NULL) = False Then 58 Dim error = GetLastError() 59 Select Case error 60 Case ERROR_ALREADY_EXISTS 61 Throw New IOException("DirectoryInfo.CreateDirectory: The directory has already existed.") 62 Case Else 63 Throw New IOException("DirectoryInfo.CreateDirectory: Failed to CreateDirectory") 64 65 End Select 66 End If 58 67 End Sub 59 68 … … 98 107 99 108 If SHFileOperation(op) <> 0 Then 100 ' TODO: エラー処理 101 debug 109 Throw New IOException("DirectoryInfo.Delete: Failed to SHFileOperation.") 102 110 End If 103 111 Else … … 254 262 find = FindFirstFile(ToTCStr(Path.Combine(FullPath, searchPattern)), findData) 255 263 If find = INVALID_HANDLE_VALUE Then 256 Return New List<DirectoryInfo> 264 Throw New IOException("DirectoryInfo.GetFileSystemInfos: Failed to FindFirstFile.") 265 Return Nothing 257 266 End If 258 267 … … 274 283 Return files 275 284 Else 276 debug 'Exception285 Throw New IOException("DirectoryInfo.GetFileSystemInfos: Failed to FindNextFile.") 277 286 Return Nothing 278 287 End If … … 287 296 Sub MoveTo(destDirName As String) 288 297 If MoveFile(ToTCStr(FullPath), ToTCStr(destDirName)) = FALSE Then 289 'Exception298 Throw New IOException("DirectoryInfo.MoveTo: Failed to MoveFile.") 290 299 End If 291 300 End Sub
Note:
See TracChangeset
for help on using the changeset viewer.