
Tim Peters wrote:
[James C. Ahlstrom]
... Python seems to lack a CRC-32 function, so I wrote one
Unfortunately, there are many different CRC functions in common use. None belong in md5; if the intent is to support just zip's version, adding a (say) zipcrc32 function to binascii would be ok; if we expect to support others as well, a new parameterized crc module would be in order.
OK, a CRC-32 in binascii it is. The CRC-32 I have comes with these comments which seem to indicate it is a more "official standard" CRC-32 than average: # * Crc - 32 BIT ANSI X3.66 CRC checksum files #*********************************************************************\ #* *| #* Demonstration program to compute the 32-bit CRC used as the frame *| #* check sequence in ADCCP (ANSI X3.66, also known as FIPS PUB 71 *| #* and FED-STD-1003, the U.S. versions of CCITT's X.25 link-level *| #* protocol). The 32-bit FCS was added via the Federal Register, *| #* 1 June 1982, p.23798. I presume but don't know for certain that *| #* this polynomial is or will be included in CCITT V.41, which *| #* defines the 16-bit CRC (often called CRC-CCITT) polynomial. FIPS *| #* PUB 78 says that the 32-bit FCS reduces otherwise undetected *| #* errors by a factor of 10^-5 over 16-bit FCS. *| #* *| #********************************************************************* #* Copyright (C) 1986 Gary S. Brown. You may use this program, or #* code or tables extracted from it, as desired without restriction. I can submit this as a patch to binascii, or if the Copyright bothers anyone, maybe it is better for Guido to use his CRC-32 from his ZIP code. Preference?
I can't seem to get WinZip to record a partial path. That is,
dialog box, you need to cd to the *Lib* directory, check the "Save extra folder info" box, and then, e.g.,
Thanks. I knew there had to be some magic incantation to do it.
6. Use a comand-line zip tool instead (e.g., pkzip; I think WinZip has an "experimental" cmdline add-on too, but haven't tried it).
Actually pkzip 2.04g doesn't work because it writes names in upper case and is limited to 8.3 names (I think). My zipfile.py can be used as a basis for a command line tool. Actually I use makefiles with imbedded Python programs and find this easier than command line tools. JimA