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 >
Pascal/Delphi Source File  |  1992-03-27  |  3KB  |  111 lines

  1. (5253)  Sat 21 Mar 92  0:45
  2. By: Darren Lyon
  3. To: All
  4. Re: ArjDate (2/4)
  5. St:
  6. ---------------------------------------------------------------------------
  7. @EID:eafc 187505a0
  8. @MSGID: 3:690/660.4 176eb94d
  9. { List the contents of an ARJ file, and set the file's date and time }
  10. { stamp to the oldest file date/tiem stamp.                          }
  11. Program ArjDate;
  12.  
  13. Uses Dos;
  14.  
  15. Type
  16.    { The main ARJ signature, at the start of the file }
  17.    ARJsignature = Record
  18.       MagicNumber : Word;
  19.       BasicHdrSiz : Word;
  20.       End;
  21.  
  22.    { What each ARJ header record contains }
  23.    ARJheader = Record
  24.       FirstHdrSize : Byte;
  25.       ARJversion   : Byte;
  26.       ARJrequired  : Byte;
  27.       HostOS       : Byte;
  28.       Flags        : Byte;
  29.       Method       : Byte;
  30.       FileType     : Byte;
  31.       GarbleMod    : Byte;
  32.       DateTime     : LongInt;
  33.       CompSize     : LongInt;
  34.       OrigSize     : LongInt;
  35.       OrigCRC      : Array[1..4] of Byte;
  36.       EntryName    : Word;
  37.       AccessMode   : Word;
  38.       HostData     : Word;
  39.       End;
  40.  
  41. { Our variables }
  42. Var
  43.    ArjFile   : File;
  44.    Hdr       : ARJheader;
  45.    Sig       : ARJsignature;
  46.    HeaderCrc : Longint;
  47.    FileName  : String;
  48.    JunkByte  : Byte;
  49.    BytesRead : Word;
  50.    I         : Integer;
  51.    ExtSize   : Word;
  52.    TopDate   : Longint;
  53.    FileCount : Integer;
  54.    SetTime   : Longint;
  55.    TimeStamp : DateTime;
  56.    DirInfo   : SearchRec;
  57.    FileTitle : String;
  58.  
  59. { Write a value in the range of 0-99, so that it has a 0x if less than 10 }
  60. Procedure WriteVal(Value : Integer);
  61.  
  62. Begin
  63.  
  64.    if Value < 10 then
  65.       Write('0');
  66.  
  67.    Write(value);
  68.  
  69. End;
  70.  
  71. { Print a string in uppercase }
  72. Procedure PrintUpper(Text : String);
  73.  
  74. var Loop : Integer;
  75.  
  76. Begin
  77.  
  78.    for Loop:=1 to Length(Text) do
  79.       Write(Upcase(Text[Loop]));
  80.  
  81. End;
  82.  
  83. { Decipher the packed date and time stamp, and print a date and time }
  84. Procedure WriteDate(Date : Longint);
  85.  
  86. Begin
  87.  
  88.    { Decipher the date portion }
  89.    WriteVal((Date shr 16) and $1F);
  90.    Write('/');
  91.    WriteVal((Date shr 21) and $0F);
  92.    Write('/');
  93.    WriteVal(((Date shr 25) and $7F)+80);
  94.    Write('   ');
  95.  
  96.    { Decipher the time portion }
  97.    WriteVal((Date shr 11) and $1F);
  98.    Write(':');
  99.    WriteVal((Date shr 5) and $3F);
  100.    Write(':');
  101.    WriteVal((Date and $1F) * 2);
  102.  
  103. End;
  104.  
  105.  
  106. --- msgedsq 2.0.5
  107.  * Origin: Programming - the art of re-inventing wheels! (3:690/660.4)
  108.  
  109. @PATH: 6600/4 690/660 601 644 640/821 209/209 396/1 170/400 512/0 
  110. @PATH: 512/1007 
  111.