=================================== TkZip Frequently Asked Questions =================================== (Well, someone asked me once...) Last updated 22 Mar 2008 for release 1.1.7. ====================================================================== Contents: --------- 1. I'm running under MS Windows. When I navigate to the top of the file-chooser thingie - where you get the list of available drives - TkZip takes a very long time to show me the drive list. It's as slow as a normal Windows app. What gives? 2. So how do I get TkZip to work under Windows? 3. I get a message that xxxx.yyy is not a type of file recognized by TkZip. Why? You say you support .yyy files. 4. I like to open files with TkZip using the --nomain option. Sometimes, though, something in the file I've just opened puts me in mind of something else I'd like to look at, and I'd like to get the main window back to open another file. Would you add a button to let me do that? 5. Why don't you support "xxx" files? 6. Why don't you use filename extensions? Windows does. 7. In general, my version of the file command seems pretty up to date, but can you tell me any special magic tricks that aren't generally known? 8. What types of archives does TkZip recognize, and what do I have to install to use them? 9. I get a Tcl or Tk error message when I.... 10. Under Windows, I just deleted everything from C:\Temp, and TkZip suddenly went weird on me. 11. I'm having trouble defining MIME types or viewer programs under Windows. I don't understand all that gobbledygook about Unix file commands and such. 12. I can't set certain aspects of the windows' appearance under Windows. I copied my carefully constructed config from Unix to my Windows workstation, and it looks like [expletive deleted]. 13. I can't get the right mouse button to work on the menus under Windows - which means I can't use context Help on the menu items. 14. I can't delete things from the viewer list under Windows. Yes, I've read the Help and tried setting "Button-3 Viewer Delete" just like it says, but to no avail. 15. I su'ed to root to install TkZip, and then.... 16. I don't really like that fancy-schmantzy built-in automatic install function. It's confusing, and seems like overkill. Isn't there a simpler way? 17. I can't use the "Find" function under Windows, because it requires the middle button of a 3-button mouse. 18. When I use the "What's this?" function, why do I have to select something first? Why can't I just Button-3 click on the file I'm interested and get total, instant gratification? 19. Why don't you add an ftp or http hook so I can snarf remote files and just open them transparently? 20. Why don't you use the xyz widget, Tk extension package, or library? It's got some way cool features, and makes coding a snap. 21. I have a rar file. I can open it OK in TkZip, but when I try to extract the file inside it, I see the message "Extracting", then "Done", but the extracted file never appears. What went wrong? 22. Why haven't you answered my e-mail? 23. I tried to install TkZip into my home directory, but the executable seems to have disappeared. I do have a directory called TkZip, but that doesn't do me much good. What have you done to me? 24. I tried to extract some files and TkZip acted as though all was well, but my files never appeared where they were supposed to be, or anywhere else, for that matter. 25. I tried to open a zip file,and instead of a directory list, I just saw a single line telling me how many files are in it. Needless to say, I couldn't do anything useful with this. ====================================================================== Answers: -------- 1. I'm running under MS Windows. When I navigate to the top of the file-chooser thingie - where you get the list of available drives - TkZip takes a very long time to show me the drive list. It's as slow as a normal Windows app. What gives? Answer: Each time you navigate the file-chooser widget up to the top level, it has to probe each available drive, in case you've mounted a diskette or a CD, or mapped a network drive. Unfortunately, since Windows has no real notion of a coherent file system, this causes Windows to do a physical access of each device. The majority of the delay is due to the device latency of your diskette drive(s). 2. So how do I get TkZip to work under Windows? Answer: You need to install several other utilities that Unix users take for granted. Fortunately, Windows versions of all of them are available. First, you need to install Tcl/Tk for Windows. As of the date of this FAQ, this is available for downloading from the old Scriptics url (http://www.scriptics.com). (I'm not going to try to keep up with all the recent mergers-and-acquisitions changes -- Scriptics -> Ajuba Solutions -> Interwoven, etc. The Scriptics url continues to be maintained for the benefit of the Tcl development community.) Rename the TkZip executable to TkZip.tcl. If Tcl/Tk was properly installed, files with a ".tcl" extension should be associated with the wish interpreter. You can now execute TkZip by double-clicking on TkZip.tcl in the Explorer, or make a shortcut on your desktop that points to TkZip.tcl. Next, you need to install the basic GNU utilities, and update your PATH variable to include the directory where they live. This is a set of Unix utilities for DOS/Windows. It includes a port of the file command, which TkZip requires; it also includes a number of the standard archiving and compression utilities -- GNU tar, gzip, compress, etc. These tools can be obtained from a variety of sources. As of the date of this FAQ, the following url's are good starting points: 1) http://cygwin.com 2) http://www.cs.wm.edu/~va/CS241/GNUwindows.html You will also want to install the Info-ZIP utilities (zip and unzip), available from http://www.info-zip.org/pub/infozip/. These are the free, Open Source utilities for handling zip format archives used by PKZIP and WinZip. See also the answer to Question 8 for information on other utilities you might wish to install. 3. I get a message that xxxx.yyy is not a type of file recognized by TkZip. Why? You say you support .yyy files. Answer: Wrong. TkZip does not support "dot-yyy" files. It supports "yyy" files. In other words, it does not care what the filename is, and pays no attention to filename "extensions". Instead, it uses the standard Unix "file" command (even under Windows) to probe the file to determine what kind of file it is. The file command does its magic with the aid of a file called, appropriatley enough, "magic"; the magic file contains rules for identifying a wide variety of file types based on a recognizable "signature" contained in a particular location in the file. Vendor-supplied implementations of file vary widely in quality. Recent releases of Solaris seem pretty good about this, for example, and on an AIX system gzipped files may not be recognized. I've even had an old Sun system fail to recognize a tar. I've consistently observed the GPL'ed version of file to be superior to any vendor-supplied version I've seen. However, the standard caveats apply when replacing a vendor-supplied utility: proceed with caution, and back up everything. Now, before rushing to replace the file command or the vendor's magic file, try the following. a) From the command line, enter "file xxx.yyy", where xxx.yyy is the file TkZip doesn't seem to recognize. If file doesn't recognize it, it will probably reply something like "data". b) Check TkZip's System Info (File -> Show System Info) to see whether TkZip has found the necessary utility for opening "yyy" files. If all of the above checks out, you may have uncovered a bug in TkZip. Please send me a report, telling me as much as you can about the failure. For example, does it fail under particular circumstances, like "whenever I enter a filename on the command line under Windows"? 4. I like to open files with TkZip using the --nomain option. Sometimes, though, something in the file I've just opened puts me in mind of something else I'd like to look at, and I'd like to get the main window back to open another file. Would you add a button to let me do that? Answer: No. Get a job. Seriously, the archive directory window is already way too cluttered. Try using the --iconic option if you think you might want to see the main window after all; use the --LastCloseExits option as well, and see if that doesn't do what you need. 5. Why don't you support "xxx" files? Answer: "Nobody asked me", "I never use them", "what are they?", and "I don't have a Mac". Drop me a note and we'll discuss it. 6. Why don't you use filename extensions? Windows does. Answer: Isn't that reason enough? Suppose you want to open a tarball on a tape (Unix users only). There is no filename, so relying on an extension is an irrelevant concept. Also, many vendors' package distribution files are really some sort of tarball with a funky name. TkZip has no problem recognizing and opening them. You'll never have TkZip tell you "Warning: If you change the extension, the file may become unusable." (Duh!) 7. In general, my version of the file command seems pretty up to date, but can you tell me any special magic tricks that aren't generally known? Answer: OK, here are a few. a) multi-volume zips Multi-volume zips created by PKZIP have a peculiar signature; zip can handle these files if you reassemble them as one file on your hard drive by concatenating them together in order. To get TkZip to recognize them, add the following line to your magic file, prefferrably somewhere in the vicinity of the other ZIP entries. # RBW addition 0 string PK\007\010PK Zip multipart file b) bzip files Most current Linux systems have magic files that recognize bzips, but some other Unix variants may be a bit behind the times. You can copy the entries from GNU file, but be aware that there are two sets of entries (for bzip and bzip2) in the current version, and they appear in different parts of the file. Alternatively, you can use the following entry that I used to use, which neatly handles both versions. # Bzip from ulmo@Q.Net 0 string BZ bzip compressed data, >2 byte x format v. %c, >3 byte x block size indicator %c c) shorten files I haven't heard much about this lossy compressor lately, but TkZip still supports it. Here's the magic: # RBW addition # Shorten - per shorten.h 1 string ajkg shorten file 8. What types of archives does TkZip recognize, and what do I have to install to use them? Answer: File Type Program Unix Windows Comments --------- ------- ---- ------- -------- tar tar ** * gzip gzip * * zip zip, unzip * * compress compress, ** * uncompress bzip bzip2 * * ar ar ** cpio cpio ** rpm rpm, cpio * deb ar, tar, gzip * jar zip, unzip * * rar unrar * * arj unarj * * shorten shorten * * --------------------------------------------- * = available ** = standard utility, should already be installed. Most Unix systems will already have tar, compress, cpio, and ar installed, though some vendors hide ar in an obscure directory that is not in your normal path. Most Linux distributions will install those 4, plus gzip and bzip2 by default; RPM-based systems will also install the rpm program. Windows systems by default have little in the way of useful utilities. You will need to get a port of the basic GNU utilities (Cygnus is a good place to start looking); that should get you started. You may need to get the zip and unzip packages from Info-ZIP, and Julian Seward's bzip2 package. 9. I get a Tcl or Tk error message when I.... Answer: You have definitely found a bug in the program. Send me a bug report right away. There should never be any untrapped Tcl/Tk error conditions. 10. Under Windows, I just deleted everything from C:\Temp, and TkZip suddenly went weird on me. Answer: Under Windows, TkZip by default builds its temporary cache directory under C:\Temp; you just gave TkZip a case of total amnesia. Your options are 2: a) don't clean out C:\Temp while TkZip is running, or b) use the Change Cache Dir function to point to some other directory, then save your options; now, don't clean out *that* directory while TkZip is active. 11. I'm having trouble defining MIME types or viewer programs under Windows. I don't understand all that gobbledygook about Unix file commands and such. Answer: Hint: use the "What's this?" function. This will show you the actual verbiage with which the file command identifies a file. This is what you should enter into the "File tag:" field in the "Edit MIME Types" dialogue. (If you don't know what the "What's this?" function is, look in Help -> Help under the "Main Window" and "Archive Directory Window" sections for a description.) If you feel more comfortable with filename extensions, then by all means just enter an extension like ".jpg" in the extension field and leave the tag blank. If you enter both a tag and an extension, TkZip will try the file tag probe first, then fall back on looking at the extension if that fails. If you know the proper MIME designation for the type of file, like "image/jpeg", enter that in the MIME type field, or make up a name (like "Word Document"), or leave it blank. If you're running under Windows, there's a little trick to specifying the path names for the viewer executables, because of Windows' penchant for creating infantilized directory names like "My Documents" with embedded spaces. You have to "escape" the spaces with a backslash, and use regular forward slashes in place of the usual Windows directory-separator backslashes, as in the following example. For displaying JPEGs and other graphic files, I use the excellent IrfanView freeware utility. The full pathname to this program as installed on my system is "C:\Program Files\IrfanView\i_view32.exe"; so I enter "C:/Program\ Files/IrfanView/i_view32.exe" in the viewer field of the MIME Types dialogue. 12. I can't set certain aspects of the windows' appearance under Windows. I copied my carefully constructed config from Unix to my Windows workstation, and it looks like [expletive deleted]. Answer: There are certain limitations inherent in using the native GUI "look and feel" of the target platform, as was done with the Tk toolkit. In particular, some of Tk's nifty scrollbar configuration options simply don't work under Windows. The Windows GUI is very limited, compared to the X Window system. 13. I can't get the right mouse button to work on the menus under Windows - which means I can't use context Help on the menu items. Answer: Neither can I. I'm not sure whether the limitation is due to Windows, or to the Windows implementation of the Tk toolkit. Use the "tear-off" technique described in the answer to Question 14 to get right-button context Help to work on the menus. 14. I can't delete things from the viewer list under Windows. Yes, I've read the Help and tried setting "Button-3 Viewer Delete" just like it says, but to no avail. Answer: [sigh.] There seems to be no end to the limitations of the Windows environment. The viewer list is a "tear-off" menu. Tear it off. (Click on the dotted line at the top, and the menu becomes an independent, "top level" window. Now the right button (Button-3) will function properly. This is a limitation of the Windows platform, not a TkZip bug. 15. I su'ed to root to install TkZip, and then.... Answer: Stop! I don't want to hear any more. (Windows users can move on to the next question. The grown-ups have to talk.) The flaw in this approach is that su only gives you root privileges, it doesn't execute the target user's (in this case, root's) profile; therefore, all your environment variables are still set as they were when you logged in as yourself. So, TkZip will create configuration files in *your* home directory, but they will be owned by *root*, not by you; then, when you run TkZip as yourself, it will not have the proper permissions. It only goes downhill from there. If you want to do a system-wide installation available to all users, *log in* as root and install everything, preferrably in the default locations. 16. I don't really like that fancy-schmantzy built-in automatic install function. It's confusing, and seems like overkill. Isn't there a simpler way? Answer: Sure. a) Unpack the tarball into a temporary location. b) Copy the TkZip executable to /usr/local/bin or wherever you want to put it. (Under Windows, rename it to TkZip.tcl and put it in C:\Program Files\TkZip.) c) Unpack the TkZip-x.y.z-Extras.tar file into /usr/local/share/TkZip (or C:\Program Files\TkZip if you're using Windows.) d) When you run TkZip for the first time, the install window will pop up. Just click the Close button. e) Uncheck the "Install on Upgrade" option (Options->(More)-> Installation Options->Install on Upgrade) and save your options. This will keep the auto-install dialogue from popping up every time you run a new version of TkZip. 17. I can't use the "Find" function under Windows, because it requires the middle button of a 3-button mouse. Answer: Why are you still using Windows? Under Windows, TkZip binds Button-3 (the traditional "right" button) to the Find function in the archive directory window. It's a little clumsier than under Unix, since you can't click just anywhere in the window. Because the right button is used for the "What's this?" function when the cursor is in the actual list part of the window, you can only activate Find by right-clicking on the background area of the top part of the window. 18. When I use the "What's this?" function, why do I have to select something first? Why can't I just Button-3 click on the file I'm interested and get total, instant gratification? Answer: I don't like it either, but it's a limitation of Tk. You can only bind the mouse click to the listbox as a whole, and then query what's selected. 19. Why don't you add an ftp or http hook so I can snarf remote files and just open them transparently? Answer: How much trouble is it, really, to copy the remote file to your local disk and open it? It seems to me that this falls in the same category as "Why don't you add a Favorites folder with a cute little heart icon?" - cute but useless marketing fluff. I don't happen to think that every single application needs to look and act like a web browser. I would be more inclined to listen to requests for features like this from licensed commercial users, but so far they haven't come from that source. 20. Why don't you use the xyz widget, Tk extension package, or library? It's got some way cool features, and makes coding a snap. Answer: I try to limit TkZip's dependencies on 3rd party packages. For me, it's a working tool. I use it regularly in my work as a consultant, and when I go into a shop I want to be able to install it quickly and easily on any system I may be working on - Solaris, AIX, IRIX, Linux, or even Windows. I don't have time to be stumbling over version incompatibilities and the like, I need something that just works. 21. I have a rar file. I can open it OK in TkZip, but when I try to extract the file inside it, I see the message "Extracting", then "Done", but the extracted file never appears. What went wrong? Answer: You most likely have an incomplete multipart rar archive, and a release of TkZip older than 1.1.0. Upgrade to 1.1.0 or later, then read the details in the the README file under the section on changes in release 1.1.0. 22. Why haven't you answered my e-mail? Answer: Like anyone else who receives a lot of e-mail, I occasionally have problems with mail servers and filter rules, and things get lost. If you've e-mailed me about TkZip, and haven't gotten a response, try again. I'm not trying to ignore you. 23. I tried to install TkZip into my home directory, but the executable seems to have disappeared. I do have a directory called TkZip, but that doesn't do me much good. What have you done to me? Answer: You cannot install both the executable (TkZip) and the Extras directory (also called TkZip) into the same directory. Unfortunately, the auto-install function used to let you try to do this, and would destroy your executable when it installed the Extras directory. Releases 1.1.1 and later include a check to prevent this, but you will still never be able to install both in the same place. If you need to install a private copy in your home directory, then install the Extras directory in $HOME, and the executable in $HOME/bin. 24. I tried to extract some files and TkZip acted as though all was well, but my files never appeared where they were supposed to be, or anywhere else, for that matter. Answer: Upgrade to Release 1.1.4 or later. Prior to that, There were several cases where TkZip failed to notify you if extraction failed. NOTE: There are certain archiving/compression utilities that exhibit somewhat brain-damaged behavior, making it impossible for TkZip to report extraction errors properly. The Unix versions, at least, of unarj and lharc do not emit an error message or set an error return code when certain extraction errors occur (e.g., trying to extract to a directory to which you do not have write permission); for these utilities, it is impossible for TkZip to know that anything went wrong, and it cannot notify you. The Unix port of unrar writes its error messages to stdout OK, but whoever ported it filled stdout with a bunch of advertising in ASCII art form. TkZip attempts to strip this dreck out, but you may stumble across a release we haven't seen and see a bunch of extraneous junk. Gzip and friends -- gzip (as far back as the venerable 1.2.4, and up to at least 1.3.5) and older versions of bzip/bzip2 -- try to write their error messages to stdout. Unfortunately, they are also trying to write the extracted file to stdout...do you see where this is headed? If the extracted file can't be written, it's not likely that the error message wil be, either. Therefore, if one of these programs fails on extraction, you will just get a message from TkZip stating that a "broken utility" experienced an unknown problem. 25. I tried to open a zip file,and instead of a directory list, I just saw a single line telling me how many files are in it. Needless to say, I couldn't do anything useful with this. Answer: Upgrade to Release 1.1.4 or later. In an earlier release, I accidentally broke compatibility with certain versions of unzip.