private/zip-constants.ss
(module zip-constants mzscheme

  ;; PKZIP specification:
  ;; http://www.pkware.com/company/standards/appnote/

  (define *local-file-header*                      #x04034b50)
  (define *archive-extra-record*                   #x08064b50)
  (define *central-file-header*                    #x02014b50)
  (define *digital-signature*                      #x05054b50)
  (define *zip64-end-of-central-directory-record*  #x06064b50)
  (define *zip64-end-of-central-directory-locator* #x07064b50)
  (define *end-of-central-directory-record*        #x06054b50)

  (define *system*
    (case (system-type)
      [(unix oskit) 3]
      [(windows) 0]
      [(macos) 7]
      [(macosx) 19]))
  (define *os-specific-separator-regexp*
    (case (system-type)
      [(unix macosx oskit) #rx"/"]
      [(windows) #rx"\\\\"]
      [(macos) #rx":"]))

  ;; The PKZIP specification includes an entry in the central directory for
  ;; an entry's "external file attributes," which for standard ZIP files is
  ;; the MS-DOS (i.e., FAT) directory attribute byte.

  ;; See http://en.wikipedia.org/wiki/FAT32 for a description of the directory
  ;; attribute byte.

  (define *msdos-read-only* #b00000001)
  (define *msdos-hidden*    #b00000010)
  (define *msdos-system*    #b00000100)
  (define *msdos-volume*    #b00001000)
  (define *msdos-directory* #b00010000)
  (define *msdos-archive*   #b00100000)

  (define *external-attributes:file* 0)
  (define *external-attributes:directory* *msdos-directory*)

  (provide (all-defined)))