Changeset 333 for trunk/Include/Classes/System/IO/FileSystemInfo.ab
- Timestamp:
- Sep 9, 2007, 2:21:07 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Include/Classes/System/IO/FileSystemInfo.ab
r318 r333 43 43 Sub CreationTime(ByRef value As DateTime) 44 44 m_CreationTime = value.ToFileTimeUtc() 45 If setFileTime() = False Then 46 'Exception 47 debug 48 End If 45 setFileTime() 49 46 End Sub 50 47 51 48 Function CreationTimeUtc() As DateTime 52 Dim date = CreationTime As DateTime 53 Return date.ToUniversalTime() 49 Return CreationTime.ToUniversalTime() 54 50 End Function 55 51 … … 64 60 Sub LastAccessTime(ByRef value As DateTime) 65 61 m_LastAccessTime = value.ToFileTimeUtc() 66 If setFileTime() = False Then 67 'Exception 68 debug 69 End If 62 setFileTime() 70 63 End Sub 71 64 72 65 Function LastAccessTimeUtc() As DateTime 73 Dim date = LastAccessTime As DateTime 74 Return date.ToUniversalTime() 66 Return LastAccessTime.ToUniversalTime() 75 67 End Function 76 68 … … 85 77 Sub LastWriteTime(ByRef value As DateTime) 86 78 m_LastWriteTime = value.ToFileTimeUtc() 87 If setFileTime() = False Then 88 'Exception 89 debug 90 End If 79 setFileTime() 91 80 End Sub 92 81 93 82 Function LastWriteTimeUtc() As DateTime 94 Dim date = LastWriteTime As DateTime 95 Return date.ToUniversalTime() 83 Return LastWriteTime.ToUniversalTime() 96 84 End Function 97 85 … … 138 126 m_LastWriteTime = data.ftLastWriteTime 139 127 End Sub 140 141 128 Private 142 Function setFileTime() As Boolean129 Sub setFileTime() 143 130 Dim hFile = CreateFile(ToTCStr(FullPath), GENERIC_WRITE, FILE_SHARE_READ Or FILE_SHARE_WRITE, ByVal 0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0) 144 131 If hFile = INVALID_HANDLE_VALUE Then 145 setFileTime = False132 debug 'Exception 146 133 Exit Function 147 134 End If 148 135 149 If SetFileTime(hFile, m_CreationTime, m_LastAccessTime, m_LastWriteTime) Then 150 setFileTime = True 151 Else 152 setFileTime = False 136 If SetFileTime(hFile, m_CreationTime, m_LastAccessTime, m_LastWriteTime) = False Then 137 debug 'Exception 153 138 End If 154 139 155 140 CloseHandle(hFile) 156 End Function141 End Sub 157 142 End Class 158 143
Note:
See TracChangeset
for help on using the changeset viewer.