eXtropia FAQs What do I do with a .tar file? A .tar.gz file? TAR is a UNIX command that allows you to create a single archive file containing many files. Such archiving allows you to maintain directory relationships and facilitates transferring complex programs with many separate but integrated parts that must have their relationships preserved. TAR has a plethora of options that allow you to do archiving and unpacking in many ways. However, for the purpose of unpacking CGI applications, the commands will be fairly simple.

The files on our site are now GZipped (.tar.gz). That just means we compressed them with GNU GZip. Your browser should be able to download it and recognize the file without any problems. Unpacking on UNIX
tar xvfpz file_name.tar.gz
tar xvfz file_name.tar (if "p" won't work)
TAR will go through the archive file and extract each individual directory and file, expanding them into their appropriate places beneath the current directory. The "xvfzp" letters in the TAR command above are parameters that instruct the program to decompress the files and then extract the files and directories out of the ".tar" file.

If you are not using GNU TAR, you will need to add a step to the process:
gunzip file_name.tar.gz (removes the .gz)
tar xvfp file_name.tar
tar xvf file_name.tar (if "p" won't work)

Tar Extraction Parameters:

Parameter Description
x Tells tar to extract the files.
v Tells tar to output information about the status of its extraction while it is performing the work.
f Informs tar to use the ".tar" filename as the source of the files to be extracted. The reason the "f" parameter has to be used is that tar, by default, archives files and directories to a tape drive. TAR is actually short for "[T]ape [AR]chive".
p Notes that the original permissions should be maintained.
z Instructs TAR to decompress a file first.
Unpacking on Windows and Mac If you are not using a UNIX-based web server, or donít have command line access (such as TELNET) to your UNIX-based web server, you will probably be using Winzip (Windows) or Stuffit Expander (Mac) to expand the TAR file. Youíll also use some text editor to edit the application files. If you are looking for a good text editor, we recommend Programmer's File Editor (PFE) or Ultra Edit that are both available at http://www.shareware.com/ for Windows. SimpleText and ClarisWorks are good editors for Mac. And, vi, emacs or pico are good editors for UNIX.

If you use a Windows-based text editor however, you need to be very careful about accidentally inserting platform-specific, invisible control characters (like carriage return characters) into the files. If you are editing the files on a Windows box, this is often a problem because Windows programs are well-known for their desire to insert Windows-only characters into files.

You will know that invisible characters have infected the files if you get a 500 Server Error when trying to run the application from the web, and error messages like the following if you run the application from the command line:
Illegal character \015 (carriage return) at app_name.cgi line 2.
Can't find string terminator " [some text here]" anywhere before EOF
Generally, this problem can be solved either by choosing a text editor that does not insert the characters or by setting your FTP program to upload edited files to the web server machine using "ASCII mode" instead of "BINARY mode". You should be able to set the FTP program to transfer in ASCII mode using the program's preferences. We recommend using WS_FTP that has this functionality and is available at http://www.shareware.com/.

However, if the files have already been sent over to a UNIX-based web server, you can strip bad characters using:
find . -type f -exec perl -pi -e 's|\cM||' {} \;