home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 2
/
ctrom_ii_b.zip
/
ctrom_ii_b
/
PROGRAM
/
PASCAL
/
PARADIS1
/
ARJHEAD2.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1992-03-27
|
3KB
|
118 lines
(5254) Sat 21 Mar 92 0:45
By: Darren Lyon
To: All
Re: ArjDate (3/4)
St:
---------------------------------------------------------------------------
@EID:16fd 187505a0
@MSGID: 3:690/660.4 176eba07
{ See if there is a dot ('.') in the passed string (or filename) }
Function CheckDot(Name : String) : Boolean;
var Loop : Integer;
Found : Boolean;
begin
{ Start of assuming there isn't }
Found := False;
for Loop:=1 to Length(Name) do
if Name[Loop]='.' then
Found := True; { Found one, so set to True }
CheckDot := Found; { Assign our result as the return value }
End;
{ Start of the main code }
Begin
{ Pretty intro... }
Writeln('ARJDATE, .ARJ file time stamping utility');
Writeln('Copyright (C) 1992, by Darren Lyon');
Writeln;
{ see if they passed only one parameter }
if Paramcount <> 1 then
Begin
{ Tell them how to use the program }
Write('Error: You must specify the name of ');
Writeln('the archive on the command line!');
Writeln(' Wildcards are allowed.');
Writeln;
Writeln('Examples: ArjDate Test.Arj');
Writeln(' ArjDate T*.Arj');
Halt;
End;
{ Disable IO checking, so that WE trap errors and not DOS }
{$I-}
{ If ther is no extension, assume ARJ as the default }
if CheckDot(Paramstr(1))=False then
FileTitle := Paramstr(1)+'.ARJ'
else
FileTitle := Paramstr(1);
{ Find the first file matching the name, as a starting point }
FindFirst(FileTitle, Archive, DirInfo);
{ See if ANY files match }
if DosError<>0 then
{ Tell them they specified a bogus parameter }
Begin
Write('Error: There was a problem handling ''');
PrintUpper(FileTitle);
Writeln(''', please rectify!');
Halt;
end;
{ Until we find no matching files, repeat this... }
While DosError = 0 do
Begin
{ Extract the name of the matching file }
FileName := DirInfo.Name;
{ Open the file }
Assign(ArjFile, FileName);
Reset(ArjFile, 1);
if IOResult<>0 then
Begin
{ Tell them there is a problem with this file }
{$I+}
write('Error: There was a problem accessing ''');
printupper(FileName);
writeln(''', please rectify!');
halt;
end;
{ Initialize some of our variables }
FileCount := 0;
TopDate := 0;
{ Specify the division between this and the last file (or the title) }
Writeln('- - - - - - - - - - - - - - - - - - - - - -
- - - - -');
Writeln('Archive name: ', FileName);
{ Read the header and make sure this is an Arj archive }
BlockRead(ArjFile, Sig, SizeOf(Sig));
if (IOResult<>0) or (Sig.MagicNumber<>$EA60) then
writeln('Error in archive, or not and ARJ archive')
else
{ Otherwise, proceed through the file }
begin
{ Read of the main file header, and discard }
BlockRead(ArjFile, Hdr, SizeOf(Hdr), BytesRead);
--- 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