Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple File Compare

Status
Not open for further replies.

unixb0y

Technical User
Jul 8, 2003
9
0
0
CA
What's the best way of r doing this:

If file1 is note the same size than file2 then
do something.

Thanks
Karl
 
I don't know about "best" but this is probably the simplest:
Code:
Option Explicit

Sub test()
  If Not SameSizeFiles("c:\file1.txt", "c:\file2.txt") Then
    MsgBox "Lengths are different"
  End If
End Sub

Function SameSizeFiles(File1 As String, File2 As String) As Boolean
  SameSizeFiles = (FileLen(File1) = FileLen(File2))
End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top