[Coco] trouble with AR

Robert Gault robert.gault at att.net
Sun Jan 16 07:58:33 EST 2011


Aaron Wolfe wrote:
> I've had lots of trouble unpacking the .ar files found on RTSI.  I
> have ar v1.3 and ar v2.0.
>
> For instance, the file ftp://www.rtsi.com/OS9/OS9_6X09/UTILITIES/uptime.ar
>
> with ar 1.3:
>
> {N2|03}/DD/TMP:ar -x uptime.ar
> extracting<uptime>
> ar: file not archive or damaged
> ERROR #001
>
> with ar 2.0:
>
> {N2|03}/DD/TMP:ar2 -x uptime.ar
> extracting<uptime>
> ar2: file damaged - no header at $12FE
> ERROR #001
>
> Anybody know exactly what version of 'ar' I should be using?
> Sometimes a .ar file will work for me, but a lot of them don't.
> I have a feeling I figured this out once, but I'm not doing so well
> this time around.
> -Aaron

OK, here is the answer. The file on RTSI is corrupted. It is an uncompressed 
archive using version 0, but the first header is bad.

Each AR header is 60 bytes and contains both the length of the compressed file 
and the length of the original file. It is easy to see what is in the archive by 
using a PC raw file editor or dEd under OS-9. The files clearly are not 
compressed as you can see the OS-9 $87CD and the C "STACK OVERFLOW" message.

If you look at bytes $4C-$4D and $5B-$5C they read $129E which is not right. 
Both should be changed to $1299 after which either a PC version of AR or our 
OS-9 version of AR will extract uptime, uptime.c, uptime.hlp, and uptime.man .

There may be similar problems with more AR archives on the RTSI site.

Robert



More information about the Coco mailing list