home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 2
/
ctrom_ii_b.zip
/
ctrom_ii_b
/
PROGRAM
/
PASCAL
/
PARADIS1
/
ARJHEAD3.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1992-03-27
|
4KB
|
111 lines
(5255) Sat 21 Mar 92 0:46
By: Darren Lyon
To: All
Re: ArjDate (4/4)
St:
---------------------------------------------------------------------------
@EID:62fc 187505c0
@MSGID: 3:690/660.4 176ec016
{ Convert the filename into a Pascal string, from ASCIIZ }
I := 0;
Repeat
Inc(I);
BlockRead(ArjFile, FileName[I], 1);
Until FileName[I] = #0;
FileName[0]:=Chr(I-1);
{ Wipe a comment from the file }
Repeat
BlockRead(ArjFile, JunkByte, 1);
Until JunkByte=0;
{ Read in parts of the header information as wee need them }
BlockRead(ArjFile, HeaderCRC, 4); { Discard... }
BlockRead(ArjFile, ExtSize, 2); { Extended headers, not used }
if ExtSize > 0 then
Seek(ArjFile, FilePos(ArjFile)+ExtSize+4);
{ Get the file signature }
BlockRead(ArjFile, Sig, SizeOf(Sig));
{ Print a header }
Write(' Date Time Original Compressed");
Writeln(' FileName');
Write('-------- -------- ---------- ----------");
Writeln(' ------------');
{ Keep repeating this until there are no more listed files }
While Sig.BasicHdrSiz>0 Do
Begin
{ Read the next file header }
BlockRead(ArjFile, Hdr, SizeOf(Hdr), BytesRead);
{ Convert from ASCIIZ to Pascal string }
I:=0;
Repeat
Inc(I);
BlockRead(ArjFile,FileName[I],1);
Until FileName[I]=#0;
FileName[0]:=Chr(I-1);
{ Remove a single file comment }
Repeat
BlockRead(ArjFile, JunkByte, 1);
Until JunkByte=0;
{ Compare this file's time stamp to the highest }
If Hdr.DateTime > TopDate then
TopDate := Hdr.DateTime;
{ Print some information about the file }
WriteDate(Hdr.DateTime);
Write(' ');
Write(Hdr.OrigSize:10, ' ', Hdr.CompSize:10, ' ', FileName);
Writeln;
{ We now have one more file... }
inc(FileCount, 1);
{ Discard the rest of the header, and the actual file data }
BlockRead(ArjFile,HeaderCRC,4);
BlockRead(ArjFile,ExtSize,2);
Seek(ArjFile,FilePos(ArjFile)+Hdr.CompSize);
BlockRead(ArjFile,Sig,SizeOf(Sig));
End;
{ We have listed all of the Arj files, print last date }
Writeln;
Writeln('A total of ', Filecount, ' files counted...');
Write('Latest Date/Time stamp was: ');
WriteDate(topdate);
{ Set the new file date and time }
Reset(ArjFile);
SetFTime(ArjFile, TopDate);
close(ArjFile);
end;
{ Go ahead and find the next file matching the parameters }
Writeln;
FindNext(DirInfo);
end;
End.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
I hope everyone finds this code useful! I have a hundred or so megs
worth of archives stored on disks, and almost all of them had the same
1991 dates. So I wrote this, and just ran 'ArjDate *' on each disk... It is
amazing how long ago some of that stuff was written! :-)
Cheers,
Darren
--- msgedsq 2.0.5
* Origin: Programming - the art of re-inventing wheels! (3:690/660.4)
@PATH: 6600/4 690/660 601 644 640/821 209/209 396/1 170/400 512/0
@PATH: 512/1007