Autor Beitrag
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Sa 01.11.08 19:05 
Hi,

bin derzeit auf der Suche nach nem Programm, mit dem ich folgende Geschichte realisieren kann:

Ich hab eine Reihe von Dateien, die nach dem Schema
Name_[xxxxxxxx].ext
benannt sind, wobei Name und ext beliebig sein kann und xxxxxxxx die CRC32-Prüfsumme der Datei ist.

Nun such ich ein Programm, dem ich eine Datei geben kann und dann als Ausgabe die CRC32-Prüfsumme bekomm, oder eine andere Info, die ich schnell überprüfen kann. Ich weiß, geht mit dem DEC von negaH wunderbar zu machen, aber für die gewünschten Datenmengen würd ich gern doch ne automatisierung über Batch realisieren, da ich korrekte Dateien wenn möglich gleich z.B. in nen andren Ordner verschieben möchte.

Kennt da jemand ein Tool, mit dem ich das machen könnt?

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
Flamefire
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1207
Erhaltene Danke: 31

Win 10
Delphi 2009 Pro, C++ (Visual Studio)
BeitragVerfasst: Sa 01.11.08 19:09 
warum schreibst du dir keins?
es gibt ne unit für crc32-berechnung und die überprüfung ist dann ja nur noch ne stringzerlegung, umwandlung und vergleich...
schon kannste dann mit den datein machen was du willst...

wennde die unit nicht hast/findest lad ichse hoch
BenBE Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Sa 01.11.08 19:51 
Hab erstmal mir n kleines Skript gehackt, ne sauberere Lösung würd mir aber dennoch gefallen ;-)

ausblenden C#-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
<?
set_time_limit(0);
ini_set("memory_limit","512M");
$p = "O:\\Restore\\...";
$d = opendir($p);
while($f = readdir($d)) {
    echo "\n" . $f;
    if('.' == $f[0]) {
        continue;
    }
    echo "...";
    echo crc32(file_get_contents($p . "\\" . $f));
    echo "\n";
}
closedir($d);

?>

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
Martok
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 3661
Erhaltene Danke: 604

Win 8.1, Win 10 x64
Pascal: Lazarus Snapshot, Delphi 7,2007; PHP, JS: WebStorm
BeitragVerfasst: So 02.11.08 03:05 
Das Problem versteh ich grad wirklich nicht...

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
program CRC;

uses CRC32;

var c: DWORD;
    s: TInteger8;
    e: word;
begin
  c:= 0;
  s:= 0;
  e:= 0;
  CalcFileCRC32 (ParamStr(1), c, s, e);
  WriteLn(c);
end;


Zu compilieren gegen CRC32.pas von Earl F Glynn, nicht getestet, hier im Editor entstanden ;)

Der Vergleich Dateiname/CRC und eventuelle Aktionen dürfte ja auch kein Problem sein :gruebel:

_________________
"The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."