Advertisement
C_Volume2 Files/ File Controls/ Input/ Output #67888

Check file existence and attributes

Check the existence of a file and it's attributes (DateCreated, DateLastModified, DateLastAccessed)

AI

AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Source Code
original-source
Private Sub cmdFileExist_Click()
 Dim FSO, _
  FileName As String, _
  DoExist As Boolean
 
 Set FSO = CreateObject("Scripting.FileSystemObject")
 FileName = txtFileName
 DoExist = FSO.FileExists(FileName)
 MsgBox DoExist, , "Check Existence"
End Sub

Private Sub cmdFileAttributes_Click()
 Dim FSO, F
 Dim FileName As String
 
 FileName = txtFileName
 Set FSO = CreateObject("Scripting.FileSystemObject")
 Set F = FSO.GetFile(FileName)
 MsgBox "Created : " & F.DateCreated & Chr(13) & _
   "Last Modified : " & F.DateLastModified & Chr(13) & _
   "Last Accessed : " & F.DateLastAccessed, , "Check Attributes"
End Sub
Original Comments (3)
Recovered from Wayback Machine