Stats

17.3.14

The Secret Lives of Files

Here is a fun, broad-scope trick that can help you troubleshoot problem files*.
Rename the file so that it ends with .ZIP.
I've used this trick on:
  • DWF (Autodesk's design web format)
  • PKT (Civil 3D subassembly file)
  • DOC (Microsoft Word file)
  • XLS (Microsoft Exel)
This trick allows you to look into the guts of a file*. If the file type allows it, you will see folders and XML pointer files. It probably works on formats that are not listed above, but I have not had the occasion to hack into others. (Note that this does not work on DWG files.)

Windows likes to assume we are all dumb, so when the warning message pops up about changing the extension, just click yes.

When would one do this?

Renaming the file to ZIP can be a troubleshooting tool. For example, I once had a customer with a DWF that wouldn't open.  The easiest thing would have been to plot a new one, but we did not have the original file to do so.  So, I renamed it to zip in order to see what it was missing. The manifest.XML told me what should be there, so we were able to cobble together enough of it to get it to open.

The slickest use of this tool is for recovery. Renaming a Word doc to ZIP will allow you to see text, and images in their raw form. The following image shows the guts of a renamed word document.


Inside the word folder you will find even more folders and a bunch of XML files.  All of the images are packed together in the Word > Media folder. You'll notice that all of the images are renamed based on the order in which they appear in the document.

 The text of the document is stored in document.xml file that is in the Word folder. Granted, the formatting is whack, but if this is your corrupt master's thesis or greatest novel of your generation that won't open, it's way better than retyping.

Now let's talk subassembly composer PKT files.

A PKT file is really a package of the following:

  • ATC: an XML based file that lists the parameter names and default values. 
  • CFG: A tiny little version flag
  • DLL: The real guts of the subassembly - this is the compiled result of your efforts in sub-assembly composer (SAC), or Visual studio (if you're a stud)
  • EMD: more parameters and codes
  • PVD: preview values
  • XAML: shape, point and links codes as well as data type definitions. 
You might also see:
  • XML: This file will only be present if you created the PKT with SAC. 
  • PNG (or other image format): Thumbnail image of your subassembly as defined in subassembly composer
  • HTM: Help file, if it was created and defined in subassembly composer 


There are two reasons this trick is on my mind, especially with regard to PKT files.  In one tech support case, a client had uploaded all of the individual files (ATC, DLL, CFG, etc). The person who initially responded made his own PKT from the files simply by zipping up the individual pieces and renaming.

In another case, a user emailed a PKT file to a coworker but the PKT would not work on the receiving end. After renaming it to zip and looking at the result, it turns out that an aggressive anti-virus program stripped out the DLL; a triumph in IT security, but not so great if you are trying to build a corridor. They transferred the file using FTP and bypassed the anti-virus.

Use this trick in good health. Don't forget to name ZIP files back to their original extension so they will open in the intended application.

*Make a backup first! I am not responsible for corrupt files. Use this trick at your own risk, blah blah blah.

1 comment:

  1. This is a simple and brilliant trick! thank you for sharing it.

    ReplyDelete