Re: Check Different between 2 Files

From: Kevin (sysrhy_at_netvigator.com)
Date: 11/29/03

  • Next message: Parmod: "Re: Two possible bugs (err... undocumented features) in Delphi 7."
    Date: Sat, 29 Nov 2003 10:17:21 +0800
    
    

    It is great. Thanks

    "Ray Marron" <marron+delphi@cableaz.com> wrote in message
    news:3fc76f88@newsgroups.borland.com...
    > "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: Parmod: "Re: Two possible bugs (err... undocumented features) in Delphi 7."