Changeset 462 for trunk


Ignore:
Timestamp:
Mar 8, 2008, 4:49:29 PM (17 years ago)
Author:
dai
Message:

FileSystemInfo.Existsメソッドを、ファイルが存在しない場合に呼び出すと期待値Falseではなく、例外が投げられてしまう不具合を修正。

File:
1 edited

Legend:

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

    r441 r462  
    199199    */
    200200    Function Exists() As Boolean
    201         If Not m_IsFreshed Then Refresh()
    202         If m_FileAttributes = 0 Then
     201        Dim data As WIN32_FIND_DATA
     202        Dim hFind = FindFirstFile(ToTCStr(FullPath), data)
     203        FindClose(hFind)
     204
     205        If hFind <> INVALID_HANDLE_VALUE Then
     206            Return True
     207        Else
    203208            Return False
    204         Else
    205             Return True
    206209        End If
    207210    End Function
Note: See TracChangeset for help on using the changeset viewer.