Changeset 605
- Timestamp:
- Aug 21, 2008, 7:21:48 PM (16 years ago)
- Location:
- trunk/ab5.0/ablib/src/Classes
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/ablib/src/Classes/System/IO/Exception.ab
r584 r605 61 61 @brief Windowsエラー値を基にIOExceptionを投げる。 62 62 @param[in] message エラーメッセージ 63 @param[in] error エラーコード 63 64 @author Egtra 64 65 @date 2007/12/06 65 66 */ 66 67 Sub ThrowWinIOException(msg As String, error As DWord) 67 Throw New IOException(msg, HRESULT_FROM_WIN32(error))68 Throw GetWinIOException(msg, error) 68 69 End Sub 70 71 /*! 72 @brief Windowsエラー値を基にIOExceptionインスタンスを作成する。 73 @param[in] message エラーメッセージ 74 @param[in] error エラーコード 75 @return 作成されたIOExceptionインスタンス 76 @author Egtra 77 @date 2008/08/21 78 */ 79 Function GetWinIOException(msg As String, error As DWord) As IOException 80 Return New IOException(msg, HRESULT_FROM_WIN32(error)) 81 End Function 69 82 70 83 /*! … … 74 87 @date 2007/12/06 75 88 */ 76 Sub ThrowWinLastErrorIOException(msg As String)77 Throw New IOException(msg, HRESULT_FROM_WIN32(GetLastError()))89 Sub ThrowWinLastErrorIOException(msg = Nothing As String) 90 Throw GetWinLastErrorIOException(msg) 78 91 End Sub 92 93 94 /*! 95 @brief GetLastError()の値を基にIOExceptionインスタンスを作成する。 96 @param[in] message エラーメッセージ 97 @return 作成されたIOExceptionインスタンス 98 @author Egtra 99 @date 2008/08/21 100 */ 101 Function GetWinLastErrorIOException(msg As String) As IOException 102 Return New IOException(msg, HRESULT_FROM_WIN32(GetLastError())) 103 End Function 79 104 End Namespace 80 105 -
trunk/ab5.0/ablib/src/Classes/System/IO/File.ab
r476 r605 1 1 Namespace System 2 2 Namespace IO 3 4 /*5 @brief ファイルのアクセス方法を表す6 */7 Enum FileAccess8 Read = GENERIC_READ9 ReadWrite = GENERIC_READ Or GENERIC_WRITE10 Write = GENERIC_WRITE11 End Enum12 13 /*14 @brief ファイルの属性を表す15 */16 Enum FileAttributes17 Archive = FILE_ATTRIBUTE_ARCHIVE18 Compressed = FILE_ATTRIBUTE_COMPRESSED19 Device = FILE_ATTRIBUTE_DEVICE20 Directory = FILE_ATTRIBUTE_DIRECTORY21 Encrypted = FILE_ATTRIBUTE_ENCRYPTED22 Hidden = FILE_ATTRIBUTE_HIDDEN23 Normal = FILE_ATTRIBUTE_NORMAL24 NotContentIndexed = FILE_ATTRIBUTE_NOT_CONTENT_INDEXED25 Offline = FILE_ATTRIBUTE_OFFLINE26 ReadOnly = FILE_ATTRIBUTE_READONLY27 ReparsePoint = FILE_ATTRIBUTE_REPARSE_POINT28 SparseFile = FILE_ATTRIBUTE_SPARSE_FILE29 System = FILE_ATTRIBUTE_SYSTEM30 Temporary = FILE_ATTRIBUTE_TEMPORARY31 End Enum32 33 /*34 @brief ファイルの作成モードを表す35 */36 Enum FileMode37 Append = OPEN_ALWAYS38 Create = CREATE_ALWAYS39 CreateNew = CREATE_NEW40 Open = OPEN_EXISTING41 OpenOrCreate = OPEN_ALWAYS42 Truncate = TRUNCATE_EXISTING43 End Enum44 45 /*46 @brief ファイルの共有を表す47 */48 Enum FileShare49 None = 050 Read = FILE_SHARE_READ51 Write = FILE_SHARE_WRITE52 ReadWrite = FILE_SHARE_READ Or FILE_SHARE_WRITE53 DeleteFile = FILE_SHARE_DELETE54 End Enum55 3 56 4 /* -
trunk/ab5.0/ablib/src/Classes/System/IO/FileStream.ab
r560 r605 1 'Classes/System/IO/FileStream.ab 2 1 3 Namespace System 2 4 Namespace IO 3 5 4 /* ほんとはmiscに入れるかかファイルを分けたほうがいいかもしれないが一先ず実装 */ 5 Enum FileOptions 6 None = 0 7 Asynchronous = FILE_FLAG_OVERLAPPED 8 DeleteOnClose = FILE_FLAG_DELETE_ON_CLOSE 9 Encrypted = FILE_ATTRIBUTE_ENCRYPTED 10 RandomAccess = FILE_FLAG_RANDOM_ACCESS 11 SequentialScan = FILE_FLAG_SEQUENTIAL_SCAN 12 WriteThrough = FILE_FLAG_WRITE_THROUGH 13 End Enum 6 /* 7 (handle As IntPtr, access As FileAccess) 8 (handle As IntPtr, access As FileAccess, ownsHandle As Boolean) 9 (handle As IntPtr, access As FileAccess, ownsHandle As Boolean) 10 (handle As IntPtr, access As FileAccess, ownsHandle As Boolean, isAsync As Boolean) 11 (path As String, mode As FileMode) 12 (path As String, mode As FileMode, access As FileAccess) 13 (path As String, mode As FileMode, access As FileAccess, share As FileShare, useAsync As Boolean) 14 (path As String, mode As FileMode, access As FileAccess, share As FileShare, options As FileOptions) 15 (path As String, mode As FileMode, rights As FileSystemRights, share As FileShare, options As FileOptions) 16 */ 14 17 15 18 Class FileStream 16 19 Inherits Stream 17 18 handle As HANDLE 19 20 /* 21 ファイルハンドルからこれらを取得できれば、これらは入らないが 22 今のところは不明なので自前で実装するしかない 23 */ 24 filePath As String 25 fileMode As DWord 26 fileAccess As DWord 27 fileShare As DWord 28 fileOptions As DWord 29 ownsHandle As Boolean 30 31 offset As QWord 'オーバーラップドIO用 32 33 Sub _Initialize(path As String, mode As FileMode, access As FileAccess, share As FileShare, options As FileOptions) 34 If ActiveBasic.IsNothing(path) Then 20 Protected 21 Sub initialize(ac As DWord, owns As Boolean, isAsync As Boolean) 22 Imports ActiveBasic 23 ownsHandle = owns 24 If (ac And GENERIC_READ) = 0 Then 25 readFn = New Detail.Unreadable 26 End If 27 If (ac And GENERIC_WRITE) = 0 Then 28 writeFn = New Detail.Unwritable 29 End If 30 If GetFileType(handle) <> FILE_TYPE_DISK Then 31 seekFn = New Detail.Unseekable 32 End If 33 If isAsync Then 34 If IsNothing(seekFn) Then 35 seekFn = New Detail.OverlappedSeekable 36 End If 37 If IsNothing(readFn) Then 38 readFn = New Detail.OverlappedReadable 39 End If 40 If IsNothing(writeFn) Then 41 writeFn = New Detail.OverlappedWritable 42 End If 43 Else 44 If IsNothing(seekFn) Then 45 seekFn = New Detail.Seekable 46 End If 47 If IsNothing(readFn) Then 48 readFn = New Detail.Readable 49 End If 50 If IsNothing(writeFn) Then 51 writeFn = New Detail.Writable 52 End If 53 End If 54 End Sub 55 56 Sub openFile(path As String, mode As FileMode, rights As DWord, share As FileShare, ByRef options As FileOptions) 57 Imports ActiveBasic 58 If IsNothing(path) Then 35 59 Throw New ArgumentNullException("path") 36 60 ElseIf path.Length = 0 Then 37 Throw New ArgumentException 38 End If 39 40 41 Dim ac = access As DWord 61 Throw New ArgumentException("path.Length = 0") 62 End If 42 63 Dim sh = share As DWord 43 64 Dim mo = mode As DWord 44 65 Dim op = options As DWord 45 ' If (Environment.OSVersion.Platform As DWord) <> (PlatformID.Win32NT As DWord) Then 'ToDo: なぜかアクセス違反になる 46 op And= Not FILE_FLAG_OVERLAPPED 47 ' End If 48 49 This.handle=CreateFile(ToTCStr(path),ac,sh,ByVal NULL,mo,op,0) 50 If This.handle=INVALID_HANDLE_VALUE Then 66 67 If mode = FileMode.Append Then 68 mo = OPEN_ALWAYS 69 seekFn = New Detail.Unseekable 70 End If 71 72 Dim os = Environment.OSVersion 73 Dim platform = os.Platform As DWord 74 If platform = PlatformID.Win32Windows As DWord Or platform = PlatformID.Win32S As DWord Then 75 options = (op As DWord And Not FILE_FLAG_OVERLAPPED) As FileOptions 76 End If 77 78 handle = CreateFile(ToTCStr(path), rights, sh, ByVal NULL, mo, op, 0) 79 If handle = INVALID_HANDLE_VALUE Then 51 80 'エラー処理 52 81 'Throw ArgumentException 53 82 'Throw IOException 54 'Throw System.IO.FileNotFoundException 55 This.handle=083 'Throw System.IO.FileNotFoundException 84 handle = 0 56 85 Detail.ThrowWinLastErrorIOException("Failed to open/create file.") 57 Exit Sub 58 End If 59 60 This.filePath = path 61 This.fileMode = mo 62 This.fileAccess = ac 63 This.fileShare = sh 64 This.fileOptions = op 65 This.offset = 0 66 This.ownsHandle = True 67 68 If FileMode.Append = This.fileMode Then 86 End If 87 88 filePath = path 89 90 If mode = FileMode.Append Then 69 91 Seek(0, SeekOrigin.End) 70 92 End If 71 93 End Sub 72 94 95 Sub initWithOpen(path As String, mode As FileMode, access As FileAccess, share As FileShare, options As FileOptions) 96 openFile(path, mode, access As DWord, share, options) 97 initialize(access, True, UseOverlappled(options)) 98 End Sub 99 100 Sub initWithOpen2(path As String, mode As FileMode, rights As DWord, share As FileShare, options As FileOptions) 101 openFile(path, mode, rights, share, options) 102 Dim ac = 0 As DWord 103 If (rights And GENERIC_READ) Or (rights And FILE_READ_DATA) Then 104 ac = (ac As DWord Or GENERIC_READ) As FileAccess 105 End If 106 If (rights And GENERIC_WRITE) Or (rights And FILE_WRITE_DATA) Then 107 ac = (ac As DWord Or GENERIC_WRITE) As FileAccess 108 End If 109 initialize(ac, True, UseOverlappled(options)) 110 End Sub 111 112 Static Function UseOverlappled(options As FileOptions) As Boolean 113 Dim op = options As DWord 114 If op And FILE_FLAG_OVERLAPPED Then 115 UseOverlappled = True 116 Else 117 UseOverlappled = False 118 End If 119 End Function 120 121 Sub FileStream() 122 End Sub 73 123 Public 74 /* コンストラクタ.NETと同じように実装は難しい、一先ず動くものを実装したが変更が必要だと思う */ 124 /*! 125 @brief ファイルを開く。 126 @param[in] path ファイルパス 127 @param[in] mode 開き方 128 @param[in] rights 使用するアクセス権の指定 129 @param[in] share 共有方法 130 @param[in] option オプション 131 @date 2008/08/21 132 @auther Egtra 133 */ 134 Sub FileStream(path As String, mode As FileMode, rights As Security.AccessControl.FileSystemRights, share As FileShare, options As FileOptions) 135 initWithOpen2(path, mode, rights As DWord, share, options) 136 End Sub 137 /*! 138 @brief ファイルを開く。 139 @param[in] path ファイルパス 140 @param[in] mode 開き方 141 @param[in] access ファイルアクセスの指定 142 @param[in] share 共有方法 143 @param[in] option オプション 144 */ 75 145 Sub FileStream(path As String, mode As FileMode, access As FileAccess, share As FileShare, options As FileOptions) 76 _Initialize( path, mode, access, share, options ) 77 End Sub 146 initWithOpen(path, mode, access, share, options) 147 End Sub 148 /*! 149 @brief ファイルを開く。 150 @param[in] path ファイルパス 151 @param[in] mode 開き方 152 @param[in] access ファイルアクセスの指定 153 @param[in] share 共有方法 154 @param[in] useAsync 非同期にするならTrue 155 @date 2008/08/21 156 @auther Egtra 157 */ 158 Sub FileStream(path As String, mode As FileMode, access As FileAccess, share As FileShare, useAsync As Boolean) 159 Dim options = FileOptions.None 160 If useAsync Then 161 options = FileOptions.Asynchronous 162 End If 163 initWithOpen(path, mode, access, share, options) 164 End Sub 165 /*! 166 @brief ファイルを開く。 167 @param[in] path ファイルパス 168 @param[in] mode 開き方 169 @param[in] access ファイルアクセスの指定 170 @param[in] share 共有方法 171 */ 78 172 Sub FileStream(path As String, mode As FileMode, access As FileAccess, share As FileShare) 79 _Initialize(path,mode,access,share,FileOptions.None) 80 End Sub 173 initWithOpen(path,mode,access,share,FileOptions.None) 174 End Sub 175 /*! 176 @brief ファイルを開く。 177 @param[in] path ファイルパス 178 @param[in] mode 開き方 179 @param[in] access ファイルアクセスの指定 180 */ 81 181 Sub FileStream(path As String, mode As FileMode, access As FileAccess) 82 _Initialize(path,mode,access,FileShare.None,FileOptions.None) 83 End Sub 182 initWithOpen(path,mode,access,FileShare.None,FileOptions.None) 183 End Sub 184 /*! 185 @brief ファイルを開く。 186 @param[in] path ファイルパス 187 @param[in] mode 開き方 188 */ 84 189 Sub FileStream(path As String, mode As FileMode) 85 190 Dim access As FileAccess … … 98 203 access=FileAccess.Write 99 204 End Select 100 _Initialize(path,mode,access,FileShare.None,FileOptions.None) 101 End Sub 102 /* 205 initWithOpen(path,mode,access,FileShare.None,FileOptions.None) 206 End Sub 207 /*! 208 @brief 既存ハンドルを基にストリームを作る。 209 @param[in] h ハンドル 210 @param[in] access ファイルアクセスの指定 211 @param[in] owns 所有権を保持するかどうか(TrueならDispose時に基のハンドルも閉じる) 212 @param[in] isAsync 重複IOを使用するかどうか 103 213 @date 2008/02/26 104 214 @auther Egtra 105 '不要になったら削除すること106 */ 107 Sub FileStream(h As HANDLE, access As FileAccess, owns As Boolean)215 @todo SafeFileHandle版に置き換えること 216 */ 217 Sub FileStream(h As HANDLE, access As FileAccess, owns = True As Boolean, isAsync = False As Boolean) 108 218 handle = h 109 fileAccess = access As DWord 110 ownsHandle = owns 111 End Sub 112 219 initialize(access, owns, isAsync) 220 End Sub 113 221 Public 114 222 /*! … … 116 224 */ 117 225 Override Function CanRead() As Boolean 118 If This.fileAccess And GENERIC_READ Then 119 Return True 120 Else 121 Return False 122 End If 226 Return readFn.CanRead 123 227 End Function 124 228 … … 127 231 */ 128 232 Override Function CanSeek() As Boolean 129 If GetFileType(This.handle)=FILE_TYPE_DISK Then 130 Return True 131 Else 132 Return False 133 End If 134 End Function 135 136 ' Override Function CanTimeout() As Boolean 137 ' /* ファイルがタイムアウトに対応しているかを返す */ 138 ' Return False /*今のところ対応していないのでFalse*/ 139 ' End Function*/ 233 Return seekFn.CanSeek 234 End Function 140 235 141 236 /*! … … 143 238 */ 144 239 Override Function CanWrite() As Boolean 145 If This.fileAccess And GENERIC_WRITE Then 146 Return True 147 Else 148 Return False 149 End If 150 End Function 151 240 Return writeFn.CanWrite 241 End Function 242 243 /*! 244 @brief 保持しているハンドルを返す 245 */ 152 246 Function Handle() As HANDLE 153 247 Return handle 154 248 End Function 155 249 156 /*! 157 @brief ファイルが非同期操作に対応しているかを返す 158 */ 159 Function IsAsync() As Boolean 160 If This.fileOptions And FILE_FLAG_OVERLAPPED /*FileOptions.Asynchronous*/ Then 161 Return True 162 Else 163 Return False 164 End If 165 End Function 166 167 Override Function Length() As Int64 168 disposedCheck() 169 If This.CanSeek() Then 170 Dim length = VarPtr(Length) As *ULARGE_INTEGER 171 length->LowPart = GetFileSize(This.handle, VarPtr(length->HighPart)) 172 If LODWORD(Length) = INVALID_FILE_SIZE Then 173 Dim error = GetLastError() 174 If error <> NO_ERROR Then 175 ' Detail.ThrowWinIOException("FileStream.Read: Failed to read.", error) 176 End If 177 End If 178 179 If Length < 0 Then 180 Debug 'Throw OverflowException 181 End If 182 End If 250 Override Function Length() As QWord 251 disposedCheck() 252 Length = seekFn.Length(This) 183 253 End Function 184 254 … … 186 256 Return This.filePath 187 257 End Function 188 189 Override Sub Position(value As Int64) 190 disposedCheck() 191 If This.CanSeek() Then 192 If This.IsAsync() Then 193 offset = value As QWord 194 Else 195 Dim position As LARGE_INTEGER 196 position.LowPart=LODWORD(value) 197 position.HighPart=HIDWORD(value) 198 SetFilePointer(This.handle,position.LowPart,VarPtr(position.HighPart) As *DWord,FILE_BEGIN) 199 End If 200 End If 201 End Sub 202 Override Function Position() As Int64 203 disposedCheck() 204 If This.CanSeek() Then 205 If This.IsAsync() Then 206 Return offset As Int64 207 Else 208 Dim position As LARGE_INTEGER 209 ZeroMemory(VarPtr(position),SizeOf(LARGE_INTEGER)) 210 position.LowPart=SetFilePointer(This.handle,position.LowPart,VarPtr(position.HighPart) As *DWord,FILE_CURRENT) 211 Return MAKEQWORD(position.LowPart,position.HighPart) As Int64 212 End If 213 End If 214 End Function 215 216 /* Override Sub ReadTimeout(value As Long) 217 'TODO 218 End Sub 219 Override Function ReadTimeout() As Long 220 'TODO 221 End Function*/ 222 258 259 Override Sub Position(value As QWord) 260 disposedCheck() 261 seekFn.Position(This, value) 262 End Sub 263 Override Function Position() As QWord 264 disposedCheck() 265 Position = seekFn.Position(This) 266 End Function 267 268 Public 223 269 /* Safe~Handle系の実装は要相談!! */ 224 270 /* Function SafeFileHandle() As SafeFileHandle 225 271 End Function*/ 226 272 227 Override Sub WriteTimeout(value As Long)228 'TODO229 End Sub230 Override Function WriteTimeout() As Long231 'TODO232 End Function233 234 235 273 Public 236 274 Override Function BeginRead(buffer As *Byte, offset As Long, count As Long, callback As AsyncCallback, state As Object) As System.IAsyncResult 237 If This.IsAsync() Then 238 Else 239 Read(buffer,offset,count) 240 End If 275 disposedCheck() 276 If buffer = 0 Then 277 Throw New ArgumentNullException("FileStream.BeginRead", "buffer") 278 End If 279 BeginRead = readFn.BeginRead(This, buffer, offset, count, callback, state) 241 280 End Function 242 281 243 282 Override Function BeginWrite(buffer As *Byte, offset As Long, count As Long, callback As AsyncCallback, state As Object) As System.IAsyncResult 244 If This.IsAsync() Then 245 Else 246 Write(buffer,offset,count) 247 End If 248 End Function 249 250 /* CreateObjRef*/ 251 283 disposedCheck() 284 If buffer = 0 Then 285 Throw New ArgumentNullException("FileStream.BeginWrite", "buffer") 286 End If 287 BeginWrite = writeFn.BeginWrite(This, buffer, offset, count, callback, state) 288 End Function 289 252 290 Override Function EndRead(asyncResult As System.IAsyncResult) As Long 253 'TODO 291 disposedCheck() 292 EndRead = readFn.EndRead(This, asyncResult) 254 293 End Function 255 294 256 295 Override Sub EndWrite(asyncResult As System.IAsyncResult) 257 'TODO 258 End Sub 259 260 /* Equals*/ 296 disposedCheck() 297 writeFn.EndWrite(This, asyncResult) 298 End Sub 261 299 262 300 Override Sub Flush() … … 264 302 Dim ret = FlushFileBuffers(This.handle) 265 303 If ret = FALSE Then 266 ' Detail.ThrowWinLastErrorIOException("FileStream.Read: Failed to read.")304 Detail.ThrowWinLastErrorIOException("FileStream.Flush: Failed to flush.") 267 305 End If 268 306 End Sub … … 272 310 End Function*/ 273 311 274 /* GetLifetimeService*/ 275 276 /* Override Function GetType() As TypeInfo 277 Return Super.GetType() 278 End Function*/ 279 280 /* InitializeLifetimeService*/ 281 282 Sub Lock(position As Int64, length As Int64) 312 Sub Lock(position As QWord, length As QWord) 283 313 disposedCheck() 284 314 If position < 0 Then 285 Throw New ArgumentOutOfRangeException("FileStream.Lock: An argument is negative value.", New System. Int64(position), "position")315 Throw New ArgumentOutOfRangeException("FileStream.Lock: An argument is negative value.", New System.UInt64(position), "position") 286 316 ElseIf length < 0 Then 287 Throw New ArgumentOutOfRangeException("FileStream.Lock: An argument is negative value.", New System.Int64(length), "length") 288 End If 289 LockFile(handle, LODWORD(position As QWord), HIDWORD(position As QWord), 290 LODWORD(length As QWord), HIDWORD(length As QWord)) 317 Throw New ArgumentOutOfRangeException("FileStream.Lock: An argument is negative value.", New System.UInt64(length), "length") 318 End If 319 If LockFile(handle, LODWORD(position), HIDWORD(position), LODWORD(length), HIDWORD(length)) = FALSE Then 320 Detail.ThrowWinLastErrorIOException("FileStream.Lock: Failed to lock.") 321 End If 291 322 End Sub 292 323 … … 294 325 disposedCheck() 295 326 If buffer = 0 Then 296 Throw New ArgumentNullException("FileStream.Read: An argument is null value.", "buffer") 297 ElseIf Not This.CanRead() Then 298 Throw New NotSupportedException("FileStream.Read: This stream is not readable.") 299 End If 300 301 Dim ret As BOOL 302 Dim readBytes As DWord 303 If This.IsAsync() Then 304 Dim overlapped As OVERLAPPED 305 SetQWord(VarPtr(overlapped.Offset), offset) 306 overlapped.hEvent = CreateEvent(0, TRUE, FALSE, 0) 307 If overlapped.hEvent = 0 Then 308 Throw New OutOfMemoryException("FileStream.Read: Failed to create an event object.") 309 End If 310 Try 311 ret = ReadFile(This.handle, VarPtr(buffer[offset]), count, 0, overlapped) 312 If ret = FALSE Then 313 Dim error = GetLastError() 314 If error <> ERROR_IO_PENDING Then 315 Detail.ThrowWinIOException("FileStream.Read: Failed to read.", error) 316 End If 317 End If 318 ret = GetOverlappedResult(This.handle, overlapped, readBytes, TRUE) 319 If ret = FALSE Then 320 Detail.ThrowWinLastErrorIOException("FileStream.Read: Failed to read.") 321 End If 322 offset += Read 323 Finally 324 CloseHandle(overlapped.hEvent) 325 End Try 326 Else 327 ret = ReadFile(This.handle,VarPtr(buffer[offset]),count,VarPtr(readBytes),ByVal NULL) 328 If ret = FALSE Then 329 Detail.ThrowWinLastErrorIOException("FileStream.Read: Failed to read.") 330 End If 331 End If 332 Read = readBytes As Long 327 Throw New ArgumentNullException("FileStream.Read", "buffer") 328 End If 329 Read = readFn.Read(This, buffer, offset, count) 333 330 End Function 334 331 … … 344 341 Override Function Seek(offset As Int64, origin As SeekOrigin) As Int64 345 342 disposedCheck() 346 If This.CanSeek() Then 347 If This.IsAsync() Then 348 Select Case origin 349 Case SeekOrigin.Begin 350 This.offset = offset 351 Case SeekOrigin.Current 352 This.offset += offset 353 Case SeekOrigin.End 354 This.offset = This.Length + offset 355 End Select 356 Seek = This.offset As Int64 357 If Seek < 0 Then 358 ' Throw ArgumentException("FileStream.Seek: Cannot seek to negative offset.") 359 End If 360 Else 361 Dim seek = VarPtr(offset) As *ULARGE_INTEGER 362 Dim ret = SetFilePointer(This.handle, seek->LowPart, VarPtr(seek->HighPart), origin As DWord) 363 If ret = INVALID_SET_FILE_POINTER Then 364 Dim error = GetLastError() 365 If error = ERROR_NEGATIVE_SEEK Then 366 ' Throw ArgumentException("FileStream.Seek: Cannot seek to negative offset.") 367 ElseIf error <> NO_ERROR Then 368 ' Throw Detail.ThrowWinIOException("FileStream.Seek: Failed to seek.", error) 369 End If 370 End If 371 seek->LowPart = ret 372 Seek = offset 373 End If 374 End If 343 Seek = seekFn.Seek(This, offset, origin) 375 344 End Function 376 345 … … 379 348 End Sub*/ 380 349 381 Override Sub SetLength(value As Int64) 382 disposedCheck() 383 If This.CanWrite() and This.CanSeek() Then 384 If This.IsAsync() Then 385 Else 386 Dim current = This.Position() 387 This.Position(value) 388 Dim ret = SetEndOfFile(This.handle) 389 If ret = FALSE Then 390 Detail.ThrowWinLastErrorIOException("FileStream.Read: Failed to read.") 391 End If 392 Position = current 393 End If 394 End If 395 End Sub 396 397 /* Synchronized*/ 350 Override Sub SetLength(value As QWord) 351 disposedCheck() 352 seekFn.SetLength(This, value) 353 End Sub 398 354 399 355 Override Function ToString() As String … … 401 357 End Function 402 358 403 Sub Unlock(position As Int64, length As Int64) 404 disposedCheck() 405 If position < 0 Then 406 Throw New ArgumentOutOfRangeException("FileStream.Lock: An argument is negative value.", New System.Int64(position), "position") 407 ElseIf length < 0 Then 408 Throw New ArgumentOutOfRangeException("FileStream.Lock: An argument is negative value.", New System.Int64(length), "length") 409 End If 410 Dim ret = UnlockFile(handle, LODWORD(position As QWord), HIDWORD(position As QWord), 411 LODWORD(length As QWord), HIDWORD(length As QWord)) 359 Sub Unlock(position As QWord, length As QWord) 360 disposedCheck() 361 Dim ret = UnlockFile(handle, LODWORD(position), HIDWORD(position), LODWORD(length), HIDWORD(length)) 412 362 If ret = FALSE Then 413 Detail.ThrowWinLastErrorIOException("FileStream. Read: Failed to read.")363 Detail.ThrowWinLastErrorIOException("FileStream.Unlock failed") 414 364 End If 415 365 End Sub … … 417 367 Override Sub Write(buffer As *Byte, offset As Long, count As Long) 418 368 disposedCheck() 419 If This.CanWrite() Then 420 Dim writeBytes As DWord 421 If This.IsAsync() Then 422 Dim overlapped As OVERLAPPED 423 SetQWord(VarPtr(overlapped.Offset), offset) 424 overlapped.hEvent = CreateEvent(0, TRUE, FALSE, 0) 425 Dim ret = WriteFile(This.handle, VarPtr(buffer[offset]), count, 0, overlapped) 426 If ret <> FALSE Or GetLastError() = ERROR_IO_PENDING Then 427 GetOverlappedResult(This.handle, overlapped, writeBytes, TRUE) 428 End If 429 offset += writeBytes 430 CloseHandle(overlapped.hEvent) 431 Else 432 WriteFile(This.handle, VarPtr(buffer[offset]), count, VarPtr(writeBytes), ByVal NULL) 433 End If 434 End If 369 If buffer = 0 Then 370 Throw New ArgumentNullException("FileStream.Write", "buffer") 371 End If 372 writeFn.Write(This, buffer, offset, count) 435 373 End Sub 436 374 … … 438 376 Override Sub Dispose(disposing As Boolean) 439 377 If handle <> 0 Then 440 Flush()441 378 CloseHandle(InterlockedExchangePointer(ByVal VarPtr(handle), NULL)) 442 379 End If 443 380 End Sub 444 381 445 Override Function CreateWaitHandle() As System.Threading.WaitHandle446 Return New System.Threading.AutoResetEvent(False)447 End Function448 449 Private450 382 Sub disposedCheck() 451 383 If handle = 0 Then 452 ' Throw ObjectDisposedException("FileStream: This stream has closed.") 453 End If 454 End Sub 455 384 Throw New ObjectDisposedException("FileStream: This stream has already closed.") 385 End If 386 End Sub 387 388 Private 389 handle As HANDLE 390 seekFn As Detail.SeekFunctions 391 readFn As Detail.ReadFunctions 392 writeFn As Detail.WriteFunctions 393 filePath As String 394 ownsHandle As Boolean 456 395 End Class 457 458 396 459 397 End Namespace -
trunk/ab5.0/ablib/src/Classes/System/IO/MemoryStream.ab
r472 r605 173 173 Virtual Sub Capacity(value As Long) 174 174 If This.pointer = 0 Then Throw New ObjectDisposedException("MemoryStream: This stream has closed.") 175 If value < 0 Then Throw New ArgumentOutOfRangeException("MemoryStream.Capacity: A capacity is set to negative value.", New System. Int64(value),"Capacity")176 If value < This.streamLength Then Throw New ArgumentOutOfRangeException("MemoryStream.Capacity: A capacity is less than the current length of the stream.",New System. Int64(value),"Capacity")175 If value < 0 Then Throw New ArgumentOutOfRangeException("MemoryStream.Capacity: A capacity is set to negative value.", New System.UInt64(value),"Capacity") 176 If value < This.streamLength Then Throw New ArgumentOutOfRangeException("MemoryStream.Capacity: A capacity is less than the current length of the stream.",New System.UInt64(value),"Capacity") 177 177 This.pointer = This.reallocate(This.pointer,value) 178 178 End Sub … … 193 193 @date 2008/3/12 194 194 */ 195 Override Function Length() As Int64195 Override Function Length() As QWord 196 196 If This.pointer = 0 Then Throw New ObjectDisposedException("MemoryStream: This stream has closed.") 197 197 Return This.streamLength … … 203 203 @date 2008/3/12 204 204 */ 205 Override Sub Position(value As Int64)206 If This.pointer = 0 Then Throw New ObjectDisposedException("MemoryStream: This stream has closed.") 207 If value < 0 Then Throw New ArgumentOutOfRangeException("MemoryStream.Position: The position is set to a negative value.", New System. Int64(value), "Position")208 If value > Int32.MaxValue() Then Throw New ArgumentOutOfRangeException("MemoryStream.Position: The position is a value greater than MaxValue.", New System. Int64(value), "Position")205 Override Sub Position(value As QWord) 206 If This.pointer = 0 Then Throw New ObjectDisposedException("MemoryStream: This stream has closed.") 207 If value < 0 Then Throw New ArgumentOutOfRangeException("MemoryStream.Position: The position is set to a negative value.", New System.UInt64(value), "Position") 208 If value > Int32.MaxValue() Then Throw New ArgumentOutOfRangeException("MemoryStream.Position: The position is a value greater than MaxValue.", New System.UInt64(value), "Position") 209 209 This.currentPosition = value As Long 210 210 End Sub … … 215 215 @date 2008/3/12 216 216 */ 217 Override Function Position() As Int64218 If This.pointer = 0 Then Throw New ObjectDisposedException("MemoryStream: This stream has closed.") 219 Return This.currentPosition As Int64217 Override Function Position() As QWord 218 If This.pointer = 0 Then Throw New ObjectDisposedException("MemoryStream: This stream has closed.") 219 Return This.currentPosition As QWord 220 220 End Function 221 221 … … 236 236 If This.pointer = 0 Then Throw New ObjectDisposedException("MemoryStream: This stream has closed.") 237 237 If buffer = 0 Then Throw New ArgumentNullException("FileStream.Read: An argument is a null value.", "buffer") 238 If offset < 0 Then Throw New ArgumentOutOfRangeException("MemoryStream.Read: An argument is a negative value.", New System. Int64(offset), "offset")239 If count < 0 Then Throw New ArgumentOutOfRangeException("MemoryStream.Read: An argument is a negative value.", New System. Int64(count), "count")238 If offset < 0 Then Throw New ArgumentOutOfRangeException("MemoryStream.Read: An argument is a negative value.", New System.UInt64(offset), "offset") 239 If count < 0 Then Throw New ArgumentOutOfRangeException("MemoryStream.Read: An argument is a negative value.", New System.UInt64(count), "count") 240 240 If (This.streamLength - (This.currentPosition + count)) < 0 Then 241 241 count + = (This.streamLength - (This.currentPosition + count)) … … 270 270 Override Function Seek(offset As Int64, origin As SeekOrigin) As Int64 271 271 If This.pointer = 0 Then Throw New ObjectDisposedException("MemoryStream: This stream has closed.") 272 If offset > Int32.MaxValue() Then Throw New ArgumentOutOfRangeException("MemoryStream.Seek: The offset is a value greater than MaxValue.", New System. Int64(offset), "offset")272 If offset > Int32.MaxValue() Then Throw New ArgumentOutOfRangeException("MemoryStream.Seek: The offset is a value greater than MaxValue.", New System.UInt64(offset), "offset") 273 273 Select Case origin 274 274 Case SeekOrigin.Begin … … 285 285 Throw New ArgumentException("MemoryStream.Seek: An argument is an invalid SeekOrigin","origin") 286 286 End Select 287 Return This.currentPosition As Int64287 Return This.currentPosition As QWord 288 288 End Function 289 289 … … 293 293 @date 2008/3/12 294 294 */ 295 Override Sub SetLength(value As Int64)295 Override Sub SetLength(value As QWord) 296 296 If This.pointer = 0 Then Throw New ObjectDisposedException("MemoryStream: This stream has closed.") 297 297 If This.writable = False Then Throw New NotSupportedException("MemoryStream: The current stream is not writable") 298 298 If This.resizable = False Then Throw New NotSupportedException("MemoryStream: The current stream is not resizable") 299 299 If value > This.Capacity() Then Throw New NotSupportedException("MemoryStream.SetLength: This stream length is larger than the current capacity.") 300 If value < 0 Then Throw New ArgumentOutOfRangeException("MemoryStream.Read: An argument is a negative value.", New System. Int64(value), "value")301 If value > Int32.MaxValue() Then Throw New ArgumentOutOfRangeException("MemoryStream.SetLength: The length is a value greater than MaxValue.", New System. Int64(value), "value")300 If value < 0 Then Throw New ArgumentOutOfRangeException("MemoryStream.Read: An argument is a negative value.", New System.UInt64(value), "value") 301 If value > Int32.MaxValue() Then Throw New ArgumentOutOfRangeException("MemoryStream.SetLength: The length is a value greater than MaxValue.", New System.UInt64(value), "value") 302 302 This.pointer = This.reallocate(This.pointer,value As Long) 303 303 This.streamLength = value As Long … … 313 313 If This.writable = False Then Throw New NotSupportedException("MemoryStream: The current stream is not writable") 314 314 If buffer = 0 Then Throw New ArgumentNullException("MemoryStream.Write: An argument is a null value.", "buffer") 315 If offset < 0 Then Throw New ArgumentOutOfRangeException("MemoryStream.Write: An argument is a negative value.", New System. Int64(offset), "offset")316 If count < 0 Then Throw New ArgumentOutOfRangeException("MemoryStream.Write: An argument is a negative value.", New System. Int64(count), "count")317 If count > (This.streamLength - This.currentPosition) Then 315 If offset < 0 Then Throw New ArgumentOutOfRangeException("MemoryStream.Write: An argument is a negative value.", New System.UInt64(offset), "offset") 316 If count < 0 Then Throw New ArgumentOutOfRangeException("MemoryStream.Write: An argument is a negative value.", New System.UInt64(count), "count") 317 If count > (This.streamLength - This.currentPosition) Then 318 318 If This.resizable = False Then Throw New NotSupportedException("MemoryStream: The current stream is not resizable") 319 If (This.Capacity() - This.currentPosition) < count Then 319 If (This.Capacity() - This.currentPosition) < count Then 320 320 This.pointer = This.reallocate(This.pointer,This.currentPosition+count) 321 321 End If -
trunk/ab5.0/ablib/src/Classes/System/IO/Stream.ab
r568 r605 4 4 5 5 Class Stream 6 Implements System.IDisposable6 Implements IDisposable 7 7 8 P ublic 'Protected8 Protected 9 9 Sub Stream() 10 10 End Sub 11 11 Public 12 VirtualSub ~Stream()12 Sub ~Stream() 13 13 This.Dispose(False) 14 14 End Sub … … 18 18 19 19 Virtual Function CanTimeout() As Boolean 20 Return True20 Return False 21 21 End Function 22 22 23 23 Abstract Function CanWrite() As Boolean 24 Abstract Function Length() As Int6425 Abstract Sub Position(value As Int64)26 Abstract Function Position() As Int6424 Abstract Function Length() As QWord 25 Abstract Sub Position(value As QWord) 26 Abstract Function Position() As QWord 27 27 28 28 Virtual Sub ReadTimeout(value As Long) 29 ' Throw InvalidOperationException29 Throw New InvalidOperationException("Stream does not support Timeout.") 30 30 End Sub 31 31 32 32 Virtual Function ReadTimeout() As Long 33 ' Throw InvalidOperationException33 Throw New InvalidOperationException("Stream does not support Timeout.") 34 34 End Function 35 35 36 36 Virtual Sub WriteTimeout(value As Long) 37 ' Throw InvalidOperationException37 Throw New InvalidOperationException("Stream does not support Timeout.") 38 38 End Sub 39 39 40 40 Virtual Function WriteTimeout() As Long 41 ' Throw InvalidOperationException41 Throw New InvalidOperationException("Stream does not support Timeout.") 42 42 End Function 43 43 44 44 Public 45 45 Virtual Function BeginRead(buffer As *Byte, offset As Long, count As Long, callback As AsyncCallback, state As Object) As System.IAsyncResult 46 Read(buffer,offset,count) 46 Dim r = Read(buffer,offset,count) 47 Return New Detail.SyncStreamResultImpl(r, state) 47 48 End Function 48 49 Virtual Function BeginWrite(buffer As *Byte, offset As Long, count As Long, callback As AsyncCallback, state As Object) As System.IAsyncResult 49 50 Write(buffer,offset,count) 51 Return New Detail.SyncStreamResultImpl(0, state) 50 52 End Function 51 53 Sub Close() … … 56 58 End Sub 57 59 Virtual Function EndRead(asyncResult As System.IAsyncResult) As Long 60 Dim ar = asyncResult As Detail.IAsyncStreamResult 61 EndRead = ar.WaitAndGetResult 58 62 End Function 59 63 Virtual Sub EndWrite(asyncResult As System.IAsyncResult) … … 73 77 74 78 Abstract Function Seek(offset As Int64, origin As SeekOrigin) As Int64 75 Abstract Sub SetLength(value As Int64)79 Abstract Sub SetLength(value As QWord) 76 80 Abstract Sub Write(buffer As *Byte, offset As Long, count As Long) 77 81 Virtual Sub WriteByte(b As Byte) … … 81 85 Virtual Sub Dispose(disposing As Boolean) 82 86 End Sub 83 Virtual Function CreateWaitHandle() As System.Threading.WaitHandle84 End Function85 87 End Class 86 88 -
trunk/ab5.0/ablib/src/Classes/System/IO/StreamReader.ab
r497 r605 34 34 Override Function Peek() As Long 35 35 If cur = last Then 36 last = s.Read(buf , 0, size)36 last = s.Read(buf As *Byte, 0, size) 37 37 cur = 0 38 38 If last = 0 Then … … 108 108 If count > size Then 109 109 n = (count \ size) * size 'sizeの倍数分だけは直接bufferへ読み込ませる 110 Dim read = s.Read(p , 0, n)110 Dim read = s.Read(p As *Byte, 0, n) 111 111 If read = 0 Then 'EOF 112 112 Exit Function … … 116 116 count -= n 117 117 End If 118 last = s.Read(buffer , 0, size)118 last = s.Read(buffer As *Byte, 0, size) 119 119 cur = 0 120 120 If last = 0 Then 'EOF -
trunk/ab5.0/ablib/src/Classes/System/IO/misc.ab
r391 r605 14 14 End Enum 15 15 16 /* 17 @brief ファイルのアクセス方法を表す 18 */ 19 Enum FileAccess 20 Read = GENERIC_READ 21 ReadWrite = GENERIC_READ Or GENERIC_WRITE 22 Write = GENERIC_WRITE 23 End Enum 24 25 /* 26 @brief ファイルの属性を表す 27 */ 28 Enum FileAttributes 29 Archive = FILE_ATTRIBUTE_ARCHIVE 30 Compressed = FILE_ATTRIBUTE_COMPRESSED 31 Device = FILE_ATTRIBUTE_DEVICE 32 Directory = FILE_ATTRIBUTE_DIRECTORY 33 Encrypted = FILE_ATTRIBUTE_ENCRYPTED 34 Hidden = FILE_ATTRIBUTE_HIDDEN 35 Normal = FILE_ATTRIBUTE_NORMAL 36 NotContentIndexed = FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 37 Offline = FILE_ATTRIBUTE_OFFLINE 38 ReadOnly = FILE_ATTRIBUTE_READONLY 39 ReparsePoint = FILE_ATTRIBUTE_REPARSE_POINT 40 SparseFile = FILE_ATTRIBUTE_SPARSE_FILE 41 System = FILE_ATTRIBUTE_SYSTEM 42 Temporary = FILE_ATTRIBUTE_TEMPORARY 43 End Enum 44 45 /* 46 @brief ファイルの作成モードを表す 47 */ 48 Enum FileMode 49 Append = -1 50 Create = CREATE_ALWAYS 51 CreateNew = CREATE_NEW 52 Open = OPEN_EXISTING 53 OpenOrCreate = OPEN_ALWAYS 54 Truncate = TRUNCATE_EXISTING 55 End Enum 56 57 /* 58 @brief ファイルの共有を表す 59 */ 60 Enum FileShare 61 None = 0 62 Read = FILE_SHARE_READ 63 Write = FILE_SHARE_WRITE 64 ReadWrite = FILE_SHARE_READ Or FILE_SHARE_WRITE 65 DeleteFile = FILE_SHARE_DELETE 66 Inheritable = &h10 67 End Enum 68 69 Enum FileOptions 70 None = 0 71 Asynchronous = FILE_FLAG_OVERLAPPED 72 DeleteOnClose = FILE_FLAG_DELETE_ON_CLOSE 73 Encrypted = FILE_ATTRIBUTE_ENCRYPTED 74 RandomAccess = FILE_FLAG_RANDOM_ACCESS 75 SequentialScan = FILE_FLAG_SEQUENTIAL_SCAN 76 WriteThrough = FILE_FLAG_WRITE_THROUGH 77 End Enum 78 16 79 End Namespace 'IO 17 80 End Namespace 'System -
trunk/ab5.0/ablib/src/Classes/System/Security/AccessControl/misc.ab
r577 r605 92 92 93 93 Enum FileSystemRights 94 ' ファイルの末尾にデータを追加する権限を指定します。 95 AppendData 96 ' ファイルまたはフォルダに関連付けられたセキュリティ規則と監査規則を変更する権限を指定します。 97 ChangePermissions 98 99 ' フォルダを作成する権限を指定します。 100 'この権限には Synchronize 値が必要です。ファイルまたはフォルダの作成時に Synchronize 値を明示的に設定しない場合、Synchronize 値は自動的に設定されます。 101 CreateDirectories 102 103 ' ファイルを作成する権限を指定します。 104 'この権限には Synchronize 値が必要です。ファイルまたはフォルダの作成時に Synchronize 値を明示的に設定しない場合、Synchronize 値は自動的に設定されます。 105 CreateFiles 106 107 ' フォルダまたはファイルを削除する権限を指定します。 108 Delete 109 ' フォルダおよびそのフォルダ内に格納されているファイルを削除する権限を指定します。 110 DeleteSubdirectoriesAndFiles 111 ' アプリケーション ファイルを実行する権限を指定します。 112 ExecuteFile 113 ' フォルダまたはファイルに対してフル コントロールを行い、アクセス制御と監査規則を変更する権限を指定します。この値は、ファイルに対してどのような操作でも行うことができる権限を表します。この値は、この列挙体のすべての権限を組み合わせたものです。 114 FullControl 115 ' ディレクトリの内容を読み取る権限を指定します。 116 ListDirectory 117 ' 読み取り、書き込み、フォルダの内容の一覧表示、フォルダとファイルの削除、およびアプリケーション ファイルの実行を行う権限を指定します。この権限には、ReadAndExecute 権限、Write 権限、および Delete 権限が含まれます。 118 Modify 119 ' フォルダまたはファイルを読み取り専用として開いたり、コピーしたりする権限を指定します。この権限には、ReadData 権限、ReadExtendedAttributes 権限、ReadAttributes 権限、および ReadPermissions 権限が含まれます。 120 Read 121 ' フォルダまたはファイルを読み取り専用として開いたりコピーしたりする権限、およびアプリケーション ファイルを実行する権限を指定します。この権限には、Read 権限および ExecuteFile 権限が含まれます。 122 ReadAndExecute 123 ' フォルダまたはファイルのファイル システム属性を開いたり、コピーしたりする権限を指定します。たとえば、この値は、ファイルの作成日や変更日を表示する権限を指定します。これには、データ、拡張ファイル システム属性、またはアクセス規則や監査規則を読み取る権限は含まれません。 124 ReadAttributes 125 ' ファイルまたはフォルダを開いたり、コピーしたりする権限を指定します。これには、ファイル システム属性、拡張ファイル システム属性、またはアクセス規則や監査規則を読み取る権限は含まれません。 126 ReadData 127 ' フォルダまたはファイルの拡張ファイル システム属性を開いたり、コピーしたりする権限を指定します。たとえば、この値は、作成者や内容に関する情報を表示する権限を指定します。これには、データ、ファイル システム属性、またはアクセス規則や監査規則を読み取る権限は含まれません。 128 ReadExtendedAttributes 129 ' フォルダまたはファイルのアクセス規則や監査規則を開いたり、コピーしたりする権限を指定します。これには、データ、ファイル システム属性、および拡張ファイル システム属性を読み取る権限は含まれません。 130 ReadPermissions 131 132 ' ファイル ハンドルが I/O 操作の完了に同期するまでアプリケーションが待機できるかどうかを指定します。 133 'Synchronize 値は、アクセスを許可すると自動的に設定され、アクセスを拒否すると自動的に除外されます。 134 'ファイルまたはフォルダを作成する権限には、この値が必要です。この値は、ファイルの作成時に明示的に設定しなくても、自動的に設定されます。 135 Synchronize 136 137 ' フォルダまたはファイルの所有者を変更する権限を指定します。リソースの所有者は、そのリソースに対してフル アクセス権限を持ちます。 138 TakeOwnership 139 ' フォルダの内容を一覧表示し、そのフォルダに格納されているアプリケーションを実行する権限を指定します。 140 Traverse 141 ' フォルダおよびファイルを作成し、ファイルに対してデータの追加または削除を行う権限を指定します。この権限には、WriteData 権限、AppendData 権限、WriteExtendedAttributes 権限、および WriteAttributes 権限が含まれます。 142 Write 143 ' フォルダまたはファイルのファイル システム属性を開いたり、フォルダまたはファイルにファイル システム属性を書き込んだりする権限を指定します。これには、データ、拡張属性、またはアクセス規則や監査規則を書き込む権限は含まれません。 144 WriteAttributes 145 ' ファイルまたはフォルダを開いたり、ファイルまたはフォルダに書き込んだりする権限を指定します。これには、ファイル システム属性、拡張ファイル システム属性、またはアクセス規則や監査規則を開いたり書き込んだりする権限は含まれません。 146 WriteData 147 ' フォルダまたはファイルの拡張ファイル システム属性を開いたり、フォルダまたはファイルに拡張ファイル システム属性を書き込んだりする権限を指定します。これには、データ、属性、またはアクセス規則や監査規則を書き込む権限は含まれません。 148 WriteExtendedAttributes 94 ReadData = FILE_READ_DATA 95 ListDirectory = FILE_LIST_DIRECTORY 96 WriteData = FILE_WRITE_DATA 97 CreateFiles = FILE_ADD_FILE 98 CreateDirectories = FILE_ADD_SUBDIRECTORY 99 AppendData = FILE_APPEND_DATA 100 ReadExtendedAttributes = FILE_READ_EA 101 WriteExtendedAttributes = FILE_WRITE_EA 102 Traverse = FILE_TRAVERSE 103 ExecuteFile = FILE_EXECUTE 104 DeleteSubdirectoriesAndFiles = FILE_DELETE_CHILD 105 ReadAttributes = FILE_READ_ATTRIBUTES 106 WriteAttributes = FILE_WRITE_ATTRIBUTES 107 Write = FILE_WRITE_DATA Or FILE_WRITE_ATTRIBUTES Or FILE_WRITE_EA Or FILE_APPEND_DATA 108 Delete = &h00010000 'DELETE 109 ReadPermissions = READ_CONTROL 110 Read = FILE_READ_DATA Or FILE_READ_ATTRIBUTES Or FILE_READ_EA Or STANDARD_RIGHTS_READ 111 ReadAndExecute = Read As DWord Or FILE_EXECUTE 112 Modify = ReadAndExecute As DWord Or Write As DWord Or &h00010000 'Delete 113 ChangePermissions = WRITE_DAC 114 TakeOwnership = WRITE_OWNER 115 Synchronize = SYNCHRONIZE 116 FullControl = &h001f01ff 149 117 End Enum 150 118 -
trunk/ab5.0/ablib/src/Classes/index.ab
r599 r605 70 70 #require "./System/IO/FileInfo.ab" 71 71 #require "./System/IO/FileStream.ab" 72 #require "./System/IO/FileStreamImpl.ab" 72 73 #require "./System/IO/FileSystemInfo.ab" 73 74 #require "./System/IO/MemoryStream.ab"
Note:
See TracChangeset
for help on using the changeset viewer.