Re: Check Different between 2 Files

From: Ray Marron (marron+delphi_at_cableaz.com)
Date: 11/28/03


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


Relevant Pages

  • Re: Fear the prospects of a new Elric movie
    ... >>> different to the point I made, how does that make the strawman mine? ... Saying you like one (whether puple novel or ... saying you can't compare or like one style of music to or over another. ... > - Kevin does not know what Moorcock's intent was in writing the Eternal ...
    (rec.games.frp.dnd)
  • RE: Field.GetChunk() doesnt differentiate between NULL and empty ntex
    ... in VB6 you can compare that field value with vbnull value ... HTH. ... Kevin Yu ...
    (microsoft.public.data.ado)
  • Re: Y&R Kevin is a coward
    ... Terrible Tom to compare her to, so he figures that since she didn't beat ... it was clear that Kevin knew his mother was ... and been placed with foster parents. ...
    (rec.arts.tv.soaps.cbs)
  • Re: Version control
    ... Kevin wrote: ... > Compare, ... Ever do a Compare-n-modify during checkin? ... > but it isn't exactly a bug. ...
    (borland.public.delphi.non-technical)