From mboxrd@z Thu Jan 1 00:00:00 1970 From: bqt@softjar.se (Johnny Billquist) Date: Fri, 09 Apr 2010 12:21:23 +0200 Subject: [pups] extract old archive format? In-Reply-To: <201004090240.o392eigZ402010@psychwarp.psych.usyd.edu.au> References: <201004090240.o392eigZ402010@psychwarp.psych.usyd.edu.au> Message-ID: <4BBEFFA3.4050005@softjar.se> John Holden wrote: >> Well I found the ar specification (in ar.5 not ar.1). >> >> struct ar_hdr { >> char ar_name[14]; >> long ar_date; >> char ar_uid; >> char ar_gid; >> int ar_mode; >> long ar_size; >> }; > > Endian should not be a problem on a Intel/AMD processor. More likely your C > compiler is padding out the array for alignment. Try a '-fpack-struct' or > more safely, read the elements individually rather than a structure. > > PS > > To check, see what 'sizeof (struct ar_hdr_)' returns. Well, you are correct in that aligment is a part of the problem. However, endianess is also a problem with longs, since they are not little-endian on a PDP11. :-) Johnny