Re: Check Different between 2 Files
From: Ray Marron (marron+delphi_at_cableaz.com)
Date: 11/28/03
- Next message: Marco Cotroneo: "Send key press to a dos program"
- Previous message: Ihor Bobak: "Multiple instances of DLL in memory."
- In reply to: Kevin: "Check Different between 2 Files"
- Next in thread: Kevin: "Re: Check Different between 2 Files"
- Reply: Kevin: "Re: Check Different between 2 Files"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 28 Nov 2003 08:53:38 -0700
"Kevin" <sysrhy@netvigator.com> wrote in message
news:3fc6bfc0$1@newsgroups.borland.com...
> Hi all,
> i want to write a D5 Code to Compare two Files is the Same
> or Not (using Last Date Time & Size), can someone kindly to
> give me some Example Code ?
Caution: Not tested - typed into newsreader!
Both files must exist and have the same timestamp and size to be considered
"the same" in this exercise.
Function SameFileTimeSize(const sFile1, sFile2: String): Boolean;
var
SR1, SR2: TSearchRec;
i: Integer;
begin
Result := False;
i := FindFirst(sFile1, faAnyFile, SR1);
if i = 0 then
begin
i := FindFirst(sFile2, faAnyFile, SR2);
if i = 0 then
begin
Result := (SR1.Time = SR2.Time) and (SR1.Size = SR2.Size);
FindClose(SR2);
end;
FindClose(SR1);
end;
end;
-- Ray Marron
- Next message: Marco Cotroneo: "Send key press to a dos program"
- Previous message: Ihor Bobak: "Multiple instances of DLL in memory."
- In reply to: Kevin: "Check Different between 2 Files"
- Next in thread: Kevin: "Re: Check Different between 2 Files"
- Reply: Kevin: "Re: Check Different between 2 Files"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|