Path: utzoo!attcan!uunet!munnari!otc!metro!basser!usage!cad!pcng From: pcng@cad.jmrc.eecs.unsw.oz (Po Cheung Ng ) Newsgroups: comp.sources.d Subject: Re: pax on 16 bit machine, tar filesize field Message-ID: <399@limpet.cad.jmrc.eecs.unsw.oz> Date: 2 Mar 89 21:52:28 GMT References: <397@limpet.cad.jmrc.eecs.unsw.oz> Organization: JMRC, School of Electrical Engineering, UNSW, Australia Lines: 32 From article <397@limpet.cad.jmrc.eecs.unsw.oz>, by pcng@cad.jmrc.eecs.unsw.oz (Po Cheung Ng ): > From article <228@libove.UUCP>, by root@libove.UUCP (Jay M. Libove): >> >> In "pax" on my 16 bit Xenix (80286) machine, it seems that the filesize >> field (in tar listings anyway, haven't tried cpio or pax format) is >> a 16 bit signed integer, because: >> > Check the source, I couldn't remember exactly, but I did patch one > public domain program to fix something like this. Locate where it prints > the file size (probably occurs in more that one place), the format string > should be %lu not %ld. I just checked my version of tar (linked to pax) and > worked fine with file size up to ~70K. Sorry, with Wietse Venema's article, now I remember the format string should be %6ld (or I prefer %6lu), not %6d. It is because printf will treat the number in the argument list as an int rather than long and mis-interpret the rest of the arguments. _ _. __ _, --- /_)_(__/) )_(_)_ [ Also known as Andrew ] / /| ' |/ ---------------- Po Cheung NG ISD: +61 2 697-4056 JMRC, School of Elec. Eng. and Comp. Sci., STD: (02) 697-4056 The University of New South Wales, FAX: +61 2 662-2087 PO Box 1, Kensington, ARPA: pcng%cad.jmrc.eecs.unsw.oz.au@uunet.uu.net Sydney, NSW 2033, JANET: cad.jmrc.eecs.unsw.oz!pcng@ukc AUSTRALIA. ACSnet: pcng@cad.jmrc.eecs.unsw.oz UUCP: {enea,hplabs,mcvax,prlb2,uunet,ubc-vision,ukc}!munnari!cad.jmrc.eecs.unsw.oz!pcng