Advertisement
6_2008-2009 Files/ File Controls/ Input/ Output #194805

File/Directory/Drive Exists (Updated)

This code returns a true/false if a specified drive/directory/pathname exists. This is a small, fast routine.

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
Function File_Exists(ByVal PathName As String, Optional Directory As Boolean) As Boolean
 'Returns True if the passed pathname exist
 'Otherwise returns False
 If PathName <> "" Then
 
 If IsMissing(Directory) Or Directory = False Then
 
  File_Exists = (Dir$(PathName) <> "")
  
 Else
 
  File_Exists = (Dir$(PathName, vbDirectory) <> "")
  
 End If
 
 End If
End Function
Upload
Original Comments (3)
Recovered from Wayback Machine