Changeset 271 for Include/Classes/System/IO/DirectoryInfo.ab
- Timestamp:
- Jun 12, 2007, 6:15:09 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Include/Classes/System/IO/DirectoryInfo.ab
r142 r271 1 2 Namespace System 3 Namespace IO 4 1 5 Class DirectoryInfo 2 6 Inherits FileSystemInfo … … 34 38 End Sub 35 39 36 /* Override Sub Delete(recursive As Boolean) 37 End Sub*/ 40 Sub Delete(recursive As Boolean) 41 If recursive Then 42 ' ディレクトリ内のすべての情報を削除する 43 44 Dim dirPath = FullPath As String 45 46 ' 終端の '\' を除去 47 If dirPath[dirPath.Length-1] = Asc("\\") Then 48 dirPath = dirPath.SubString(0, dirPath.Length-1) 49 End If 50 51 ' double null-terminated にする 52 dirPath = dirPath + Chr$(0) 53 54 Dim op As SHFILEOPSTRUCT 55 op.hwnd = NULL 56 op.wFunc = FO_DELETE 57 op.pFrom = dirPath.Chars 58 op.pTo = NULL 59 op.fFlags = FOF_NOCONFIRMATION or FOF_NOERRORUI or FOF_SILENT 60 61 If SHFileOperation(op) <> 0 Then 62 ' TODO: エラー処理 63 debug 64 End If 65 Else 66 ' ディレクトリが空の場合は削除する 67 This.Delete() 68 End If 69 End Sub 38 70 39 71 /* Function GetAccessControl() As DirectorySecurity … … 82 114 TopDirectoryOnly 83 115 End Enum 116 117 End Namespace 118 End Namespace
Note:
See TracChangeset
for help on using the changeset viewer.