home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 2
/
ctrom_ii_b.zip
/
ctrom_ii_b
/
PROGRAM
/
PASCAL
/
PARADIS1
/
ARJHEAD.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1992-03-27
|
3KB
|
111 lines
(5253) Sat 21 Mar 92 0:45
By: Darren Lyon
To: All
Re: ArjDate (2/4)
St:
---------------------------------------------------------------------------
@EID:eafc 187505a0
@MSGID: 3:690/660.4 176eb94d
{ List the contents of an ARJ file, and set the file's date and time }
{ stamp to the oldest file date/tiem stamp. }
Program ArjDate;
Uses Dos;
Type
{ The main ARJ signature, at the start of the file }
ARJsignature = Record
MagicNumber : Word;
BasicHdrSiz : Word;
End;
{ What each ARJ header record contains }
ARJheader = Record
FirstHdrSize : Byte;
ARJversion : Byte;
ARJrequired : Byte;
HostOS : Byte;
Flags : Byte;
Method : Byte;
FileType : Byte;
GarbleMod : Byte;
DateTime : LongInt;
CompSize : LongInt;
OrigSize : LongInt;
OrigCRC : Array[1..4] of Byte;
EntryName : Word;
AccessMode : Word;
HostData : Word;
End;
{ Our variables }
Var
ArjFile : File;
Hdr : ARJheader;
Sig : ARJsignature;
HeaderCrc : Longint;
FileName : String;
JunkByte : Byte;
BytesRead : Word;
I : Integer;
ExtSize : Word;
TopDate : Longint;
FileCount : Integer;
SetTime : Longint;
TimeStamp : DateTime;
DirInfo : SearchRec;
FileTitle : String;
{ Write a value in the range of 0-99, so that it has a 0x if less than 10 }
Procedure WriteVal(Value : Integer);
Begin
if Value < 10 then
Write('0');
Write(value);
End;
{ Print a string in uppercase }
Procedure PrintUpper(Text : String);
var Loop : Integer;
Begin
for Loop:=1 to Length(Text) do
Write(Upcase(Text[Loop]));
End;
{ Decipher the packed date and time stamp, and print a date and time }
Procedure WriteDate(Date : Longint);
Begin
{ Decipher the date portion }
WriteVal((Date shr 16) and $1F);
Write('/');
WriteVal((Date shr 21) and $0F);
Write('/');
WriteVal(((Date shr 25) and $7F)+80);
Write(' ');
{ Decipher the time portion }
WriteVal((Date shr 11) and $1F);
Write(':');
WriteVal((Date shr 5) and $3F);
Write(':');
WriteVal((Date and $1F) * 2);
End;
--- 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