Surfing through the WWW I got files here and there. Most of them were packed archives and I had to expand them. Mysteriously some of them can't be uncompressed! Examining this point I found that sometimes files were "translated " as text files between different systems. For the purpose to get back to the original state I wrote this little tool - and it works well for me.
x2x.zip Archive with source and executables for DOS and TOS, 18KB.
There are three calling methods and behaviours, see below for the description. The conversion key defines the translation to be done: one character of D, U, or M for the source format, one character of "2" (just for fun), and another character of D, U, or M for the destination format. The meaning of the characters are obvious: "D" stands for DOS (and TOS), "U" stands for Unix, and "M" stands for Macintosh.
Now X2X checks the file named "filename" for end-of-line characters. It counts any occurences of each format and displays the values at the end. You use this form to check the format of a file. If only one counter is not zero, you have probably a text file otherwise a binary file. If only one counter is zero, you probably have a wrongly converted binary file.
x2x d2u filename
X2X translates the file named "filename" from DOS style end-of-lines to Unix style. The converted file will be created in a temporary file and after doing all conversion the original will be erased and the new file renamed.
x2x u2m infile outfile
This command converts "infile" from Unix style into a file named "outfile" in Macintosh style.
Back to my home page.
Comments and such stuff go to: email@example.com