Autor Beitrag
hedie
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 249

WIN XP WIN 2000 WIN Longhorn
D7 Pers D2005 Architect Vollversion
BeitragVerfasst: Sa 30.07.05 00:17 
Hallo

Ich möchte so einfach wie möglich die datei grösse zweier dateien Vergleichen also etwa so:
ausblenden Delphi-Quelltext
1:
If datei1.bytes = Datei2.bytes then....					



grüsse
Claudio

Moderiert von user profile iconraziel: Delphi-Tags hinzugefügt.

_________________
Grüsse hedie
hört auf traurig zusein hört lieber radio Basilisk
matze.de
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 576

Win95, Win98 SE, WinXp Prof SP2
D7P, D8P, FPC2.0
BeitragVerfasst: Sa 30.07.05 09:08 
Versuchs am besten mit FileStreams:
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
Var
    Form1: TForm1;
    fs1, fs2: TFileStream;

Implementation

{$R *.dfm}

Procedure TForm1.FormCreate(Sender: TObject);
Var
    f1, f2: String;
Begin
    f1 := 'C:\123.txt';
    f2 := 'C:\456.txt';
    If (FileExists(f1)) And (FileExists(f2)) Then
    Begin
        fs1 := TFileStream.Create(f1, fmOpenRead);
        fs2 := TFileStream.Create(f2, fmOpenRead);
        If fs1.Size = fs2.Size Then
            ShowMessage('Dateien sind gleich groß.');
    End
    Else
        ShowMessage('Dateien existieren nur teilweise oder gar nicht.');
End;

Procedure TForm1.FormClose(Sender: TObject; Var Action: TCloseAction);
Begin
    If (Assigned(fs1)) And (Assigned(fs2)) Then
    Begin
        fs1.Free;
        fs2.Free;
    End;
End;


Mfg matze

_________________
si tacuisses, philosophus mansisses.