Loading ...
Sorry, an error occurred while loading the content.

FCW compressed files

Expand Messages
  • Bradd W. Szonye
    First a request, then an explanation. I d like to be able to read compressed FCW files. There is some software available to do this (the TKTEST library from
    Message 1 of 10 , Mar 16, 2001
    • 0 Attachment
      First a request, then an explanation. I'd like to be able to read
      compressed FCW files. There is some software available to do this (the
      TKTEST library from FastCAD), but it doesn't really suit my needs. It's
      my understanding that CC2/FastCAD uses the PKWare libraries to compress
      the data; since PKWare publishes their compression algorithms, I should
      be able to write software to do it myself. However, first I need to know
      the compression type and header information as stored in a FCW file.

      Here's why: I'm working on tools to analyze and (eventually) write CC2
      files. However, my main development environment is Unix, not Windows.
      Thus, it's a major pain (ie., reboot) to decompress the FCW files, even
      if I were to use TKTEST to do it as painlessly as possible. Also, it
      would be nice to provide my tools to both Unix and Windows users, but
      that especially requires the ability to read and write the format
      natively.

      Could anyone please tell me which PK compression type is used in the
      FCWs, and what sort of header information there is to describe the data
      stream?
      --
      Bradd W. Szonye Work: bradd@...
      Software Design Engineer Home: bradds@...
      Hewlett-Packard Cupertino Site, iFL Phone: 408-447-4832
    • Mike Riddle
      Attached is the code I use to write an FCW file, including all uses of the PkWare compression library. Releasing this source is all I can do - I know nothing
      Message 2 of 10 , Mar 16, 2001
      • 0 Attachment
        Attached is the code I use to write an FCW file, including
        all uses of the PkWare compression library. Releasing this
        source is all I can do - I know nothing of their internal
        libraries or algorithms.


        "Bradd W. Szonye" wrote:

        > First a request, then an explanation. I'd like to be able to read
        > compressed FCW files. There is some software available to do this (the
        > TKTEST library from FastCAD), but it doesn't really suit my needs. It's
        > my understanding that CC2/FastCAD uses the PKWare libraries to compress
        > the data; since PKWare publishes their compression algorithms, I should
        > be able to write software to do it myself. However, first I need to know
        > the compression type and header information as stored in a FCW file.
        >
        > Here's why: I'm working on tools to analyze and (eventually) write CC2
        > files. However, my main development environment is Unix, not Windows.
        > Thus, it's a major pain (ie., reboot) to decompress the FCW files, even
        > if I were to use TKTEST to do it as painlessly as possible. Also, it
        > would be nice to provide my tools to both Unix and Windows users, but
        > that especially requires the ability to read and write the format
        > natively.
        >
        > Could anyone please tell me which PK compression type is used in the
        > FCWs, and what sort of header information there is to describe the data
        > stream?
        > --
        > Bradd W. Szonye Work: bradd@...
        > Software Design Engineer Home: bradds@...
        > Hewlett-Packard Cupertino Site, iFL Phone: 408-447-4832
        >
        >
        > To Post a message, send it to: cc2-dev-l@...
        > To Unsubscribe, send a blank message to: cc2-dev-l-unsubscribe@...
        >
        > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
      • bradds@concentric.net
        ... Thanks! I *think* this is enough information to figure out how to do it. The folks at PKWare document their compression algorithms in
        Message 3 of 10 , Mar 17, 2001
        • 0 Attachment
          --- In cc2-dev-l@y..., Mike Riddle <mriddle@u...> wrote:
          > Attached is the code I use to write an FCW file, including
          > all uses of the PkWare compression library. Releasing this
          > source is all I can do - I know nothing of their internal
          > libraries or algorithms.

          Thanks! I *think* this is enough information to figure out how to do
          it. The folks at PKWare document their compression algorithms in
          ftp://ftp.pkware.com/appnote.zip; what I needed to know most is which
          algorithm type it was, and it looks like "implosion" (which was
          actually my guess). I still need to puzzle through the assembly code
          -- I haven't dealt with that in a while! -- but I should hopefully be
          able to figure it out.

          If I get something working, I'll put it somewhere accessible. I think
          Joe Slayton at least might have some interest in this too.

          Take care! (Nice CAD engine, by the way, Mike. Pretty good job on the
          toolkit too, now that I think of it.)

          Bradd
        • bradds@concentric.net
          ... Update: I now have a short Perl script that can decompress FCW files using PKZIP. Well, most of it. I still have some cleanup and automation to do.
          Message 4 of 10 , Mar 21, 2001
          • 0 Attachment
            --- In cc2-dev-l@y..., bradds@c... wrote:
            > If I get something working, I'll put it somewhere accessible.

            Update: I now have a short Perl script that can decompress FCW files
            using PKZIP. Well, most of it. I still have some cleanup and
            automation to do. However, the "hard" part is done.

            Here's the basic approach: Extract the FCW file header. Wrap the
            compressed data in a proper ZIP file. Use PKZIP to extract the data.
            Re-attach the FCW header.

            I still need to do some testing to make sure that it's actually
            functioning properly. Since I don't know the uncompressed size, I have
            some concerns that PKZIP may not get it right -- in fact, if you set
            the uncompressed size too low in the ZIP file, PKZIP will truncate the
            file. There are some other quirks too. The process is messy because I
            must use PKZIP, and PKZIP is an *awful* Unix program -- it behaves
            just like a DOS program, plus it leaves config files laying around.
            The only reason I'm using it is because it's the only unzipper I know
            of for Unix that implements method 10 (DCL Implode/Explode).

            However, the basics are there, so now I can convert a compressed FCW
            to an uncompressed FCW on a Unix machine. Once I get the script
            cleaned up, I'll post it or put it up on my website. If I find a
            better solution than using PKZIP, I'll put that up too. (I hope I do
            -- PKZIP is just a really, truly *awful* Unix program.)
          • Bradd W. Szonye
            ... I should point out that my approach will also work for Windows machines with PKZIP and Perl; I mention Unix because (1) that s my development platform, and
            Message 5 of 10 , Mar 21, 2001
            • 0 Attachment
              On Wed, Mar 21, 2001 at 08:45:27PM -0000, bradds@... wrote:
              > However, the basics are there, so now I can convert a compressed FCW
              > to an uncompressed FCW on a Unix machine. Once I get the script
              > cleaned up, I'll post it or put it up on my website. If I find a
              > better solution than using PKZIP, I'll put that up too. (I hope I do
              > -- PKZIP is just a really, truly *awful* Unix program.)

              I should point out that my approach will also work for Windows machines
              with PKZIP and Perl; I mention Unix because (1) that's my development
              platform, and (2) there's no other convenient way to uncompress an FCW
              there (ie., you can't just load the file in CC2 and re-save it
              uncompressed).
              --
              Bradd W. Szonye Work: bradd@...
              Software Design Engineer Home: bradds@...
              Hewlett-Packard Cupertino Site, iFL Phone: 408-447-4832
            • Linda Kekumu
              Hi :) Can you link from HTML to CC2? or from Word to CC2 - or from other programs that support hyper linking? I know we can do the reverse, I just wanted to
              Message 6 of 10 , Mar 22, 2001
              • 0 Attachment
                Hi :)

                Can you link from HTML to CC2? or from Word to CC2 - or from other programs
                that support hyper linking? I know we can do the reverse, I just wanted to
                know if other programs were as progressive?

                Linda
              • Mike Riddle
                Note that a compressed FCW file is NOT a PKZIP file - the file, after the 128-byte file id block, is compressed using the same algorithms used by PKZIP, but
                Message 7 of 10 , Mar 23, 2001
                • 0 Attachment
                  Note that a compressed FCW file is NOT a PKZIP file - the file, after
                  the 128-byte file id block, is compressed using the same algorithms used by
                  PKZIP, but does not have a ZIP file's internal directory structure.
                  As to PKZIP in UNIX being awful, I can't say, but I have always
                  liked and used PkWare's programs (and Data Compression Library)
                  and have found them stable and fast. And I've *never* had bugs in their
                  products cause me trouble. I really respect their products.

                  "Bradd W. Szonye" wrote:

                  > On Wed, Mar 21, 2001 at 08:45:27PM -0000, bradds@... wrote:
                  > > However, the basics are there, so now I can convert a compressed FCW
                  > > to an uncompressed FCW on a Unix machine. Once I get the script
                  > > cleaned up, I'll post it or put it up on my website. If I find a
                  > > better solution than using PKZIP, I'll put that up too. (I hope I do
                  > > -- PKZIP is just a really, truly *awful* Unix program.)
                  >
                  > I should point out that my approach will also work for Windows machines
                  > with PKZIP and Perl; I mention Unix because (1) that's my development
                  > platform, and (2) there's no other convenient way to uncompress an FCW
                  > there (ie., you can't just load the file in CC2 and re-save it
                  > uncompressed).
                  > --
                  > Bradd W. Szonye Work: bradd@...
                  > Software Design Engineer Home: bradds@...
                  > Hewlett-Packard Cupertino Site, iFL Phone: 408-447-4832
                  >
                  >
                  > To Post a message, send it to: cc2-dev-l@...
                  > To Unsubscribe, send a blank message to: cc2-dev-l-unsubscribe@...
                  >
                  > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
                • Bradd W. Szonye
                  ... Hi! ... I m not sure I understand -- could you please explain what you re getting at? Maybe it s just the context that has me confused; I m not sure what
                  Message 8 of 10 , Mar 23, 2001
                  • 0 Attachment
                    On Thu, Mar 22, 2001 at 08:12:11PM -1000, Linda Kekumu wrote:
                    > Hi :)

                    Hi!

                    > Can you link from HTML to CC2? or from Word to CC2 - or from other
                    > programs that support hyper linking? I know we can do the reverse, I
                    > just wanted to know if other programs were as progressive?

                    I'm not sure I understand -- could you please explain what you're
                    getting at? Maybe it's just the context that has me confused; I'm not
                    sure what this has to do with the subject.

                    Do you mean, can you click on a link to a CC2 file in an HTML doc and
                    have it fire up CC2 to open the map? Yeah, I'm pretty sure that's
                    possible. Most browsers will let you configure them so that they can
                    open files with different applications (instead of simply asking you to
                    save the file to disk). For Netscape Navigator, you do this in the
                    Applications panel of the Edit>>Preferences dialog.
                    --
                    Bradd W. Szonye Work: bradd@...
                    Software Design Engineer Home: bradds@...
                    Hewlett-Packard Cupertino Site, iFL Phone: 408-447-4832
                  • Bradd W. Szonye
                    ... That s right. That s why you need a script and not just PKZIP to do it. The easiest way to uncompress an FCW is with the PKWare library, but I don t have
                    Message 9 of 10 , Mar 23, 2001
                    • 0 Attachment
                      >> On Wed, Mar 21, 2001 at 08:45:27PM -0000, bradds@... wrote:
                      >>> However, the basics are there, so now I can convert a compressed FCW
                      >>> to an uncompressed FCW on a Unix machine.

                      On Fri, Mar 23, 2001 at 01:28:25AM -0700, Mike Riddle wrote:
                      > Note that a compressed FCW file is NOT a PKZIP file - the file, after
                      > the 128-byte file id block, is compressed using the same algorithms
                      > used by PKZIP, but does not have a ZIP file's internal directory
                      > structure.

                      That's right. That's why you need a script and not just PKZIP to do it.
                      The easiest way to uncompress an FCW is with the PKWare library, but I
                      don't have $700 to buy the libraries for Windows and Unix for what is
                      basically a hobby project. Fortunately, with a little extra work, PKZIP
                      can do the job (for decompression anyway).

                      The steps involved are:
                      1. Extract and save the FCW file ID header.
                      2. Wrap the compressed stream with a ZIP header and central directory.
                      3. Decompress with PKZIP.
                      4. Re-attach the data to the FCW header.

                      The tricky part is to do it in such a way that PKZIP doesn't leave
                      droppings all over the place.

                      > As to PKZIP in UNIX being awful, I can't say, but I have always liked
                      > and used PkWare's programs (and Data Compression Library) and have
                      > found them stable and fast. And I've *never* had bugs in their
                      > products cause me trouble. I really respect their products.

                      Oh, PKZIP for Unix seems to work well enough -- it's not buggy or
                      anything. It's just that it has some quirks that are acceptable in a
                      Windows/DOS environment that are inappropriate on a Unix system. For
                      example, every time you run it, it writes a configuration file in the
                      current directory. In Unix, that sort of thing belongs in a hidden
                      file in your home directory -- dropping files in the current directory
                      is not only not always possible, but it's a data integrity and security
                      risk.

                      I was also going to complain that there's no way to decompress to
                      standard output (instead of to a file), but I just found that one! I
                      still haven't figured out whether it's possible to supply the ZIP file
                      on standard input instead of as a filename.

                      In short, it's not that it's a poor program, it's that it has an
                      extremely poor Unix command interface. Now, for somebody who's
                      accustomed to using PKZIP-DOS, that's an advantage, but it makes it very
                      difficult for seasoned Unix users, especially if you're trying to write
                      a script.
                      --
                      Bradd W. Szonye Work: bradd@...
                      Software Design Engineer Home: bradds@...
                      Hewlett-Packard Cupertino Site, iFL Phone: 408-447-4832
                    • Bradd W. Szonye
                      ... Well, that turned out not to be the tricky part after all. On the surface, the files appear to decompress correctly, but when I try to actually read the FC
                      Message 10 of 10 , Mar 24, 2001
                      • 0 Attachment
                        On Fri, Mar 23, 2001 at 09:50:01AM -0800, Bradd W. Szonye wrote:
                        > The steps [to decompress an FCW] are:
                        > 1. Extract and save the FCW file ID header.
                        > 2. Wrap the compressed stream with a ZIP header and central directory.
                        > 3. Decompress with PKZIP.
                        > 4. Re-attach the data to the FCW header.
                        >
                        > The tricky part is to do it in such a way that PKZIP doesn't leave
                        > droppings all over the place.

                        Well, that turned out not to be the tricky part after all. On the
                        surface, the files appear to decompress correctly, but when I try to
                        actually read the FC chunks, it falls apart. There are corrupted bits
                        here and there, and the files appear to get truncated slightly. Unless I
                        make some sort of radical breakthrough, it looks like I'm going to need
                        to leave this alone for now. Oh well -- I have lots of other projects
                        I'm working on.

                        Sorry if I got anyone's hopes up! (Assuming, of course, that anyone
                        other than me is interested in this.)
                        --
                        Bradd W. Szonye Hewlett-Packard: Home:
                        Software Engineer bradd@... bradds@...
                        408-447-4832 http://www.concentric.net/~Bradds
                      Your message has been successfully submitted and would be delivered to recipients shortly.