Howard Owen wrote:
> I like pyrotechnics, so it was great fun to blow up the swap file LIF images
> into individual files.
I am not sure what you had in mind but the swap archives are split into individual files. At least the ones at
ftp://ftp.hpmuseum.org/lif/swap
All files are encoded in swap file format documented in
http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/articles.cgi?read=24, which simply involves prepending 32 bytes of header to the file. The header is the LIF directory header for that file ONLY.
The swap file format is not LIF. It only contains some elements from the LIF directory. So you do not need to "expand" the files, you simply need to skip these 32 bytes.
E.g. if I want to see the contents of file chhu01/curlex.l71, I will simply do:
arrakis% dd if=chhu01/curlex.l71 ibs=32 skip=1 | xd
000000000000 5e000000 00f00e00 00000800 10ff131b *^...............*
000000000010 694100d0 1bb013f7 f84c3641 0911db07 *iA.......L6A....*
000000000020 10b17d11 88bf411b ad139f69 d230019a *..}...A....i.0..*
000000000030 260c0013 44760013 43faa0ae fa324181 *&...Dv..C....2A.*
000000000040 bf431bda 1a3070f8 35b40187 5f431b70 *.C...0p.5..._C.p*
000000000050 0118b1f8 c12310b1 5a4e0801 5be91108 *.....#..ZN..[...*
000000000060 86bf411b 60f81bb4 01860428 0131051e *..A.`......(.1..*
000000000070 00000007 00011404 19528001 7b0d0000 *.........R..{...*
000000000080 494e4b4a 45542020 2020e214 00000525 *INKJET .....%*
000000000090 00000004 00011404 19578001 19060000 *.........W......*
0000000000a0 54454c44 49523731 5044e214 00000529 *TELDIR71PD.....)*
0000000000b0 0000000b 00011404 24348001 4e140000 *........$4..N...*
0000000000c0 4355524c 45582020 2020e208 00000534 *CURLEX .....4*
0000000000d0 00000001 00011512 06238001 db000000 *.........#......*
0000000000e0 ffffffff ffffffff ffffffff ffffffff *................*
*** SAME ***
000000000100 ........ ........ ........ ........ *................*
Moreover, your "exploded" files appear to be corrupted as well. E.g. your version of CURLEX.LEX71 is:
arrakis% xd CURLEX.LEX71
000000000000 5e000000 00f00e00 00000800 10ff131b *^...............*
000000000010 694100d0 1bb013f7 f84c3641 0911db07 *iA.......L6A....*
000000000020 10b17d11 88bf411b ad139f69 d230019a *..}...A....i.0..*
000000000030 260c0013 44760013 43faa0ae fa324181 *&...Dv..C....2A.*
000000000040 bf431bda 1a3070f8 35b40187 5f431b70 *.C...0p.5..._C.p*
000000000050 0118b1f8 c12310b1 5a4e0801 5be91108 *.....#..ZN..[...*
000000000060 86bf411b 60f81bb4 01860428 0131.... *..A.`......(.1..*
The length (0x6D) is also wrong. If we look at the curlex.l71 header we see:
arrakis% dd if=curlex.l71 ibs=32 count=1 | xd
000000000000 4355524c 45582020 2020e208 00000000 *CURLEX ......*
000000000010 00000001 00010120 33568001 db000000 *....... 3V......*
that the file length should be 0xDB bytes, 219 in decimal (file length in bytes starts at offset 0x0C, and it is 3 bytes long (LSB first).
Note also that even files that are not encoded in any way (e.g. chhu01/acopy.text) are damaged. So you should check your program to make sure it decodes the files correctly.
Finally, simply looking at the filename inside the header and using this to name the extracted file is not sufficient as file names may have characters that are not acceptable to the local file system (e.g. \), you need some kind of mapping for the unacceptable characters.
Best Regards
**vp
Edited: 14 Aug 2005, 2:17 a.m.