*** Begin of README file, Version 1.0.6 ***
 
  "truc & untruc" scripts allow you to send and receive big files or 
  directories using e-mail.
  Copyright 1994-1998 - David Segonds
 
  Version 1.0.6, last modification: 23 Jul 98
  Contact: segonds@ensg.u-nancy.fr
  URL: http://www.ensg.u-nancy.fr/~segonds/truc
 
  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.
 
  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.
 
  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

1.0 Introduction
================

The main components of this package are "truc" and "untruc", two
Bourne shell script files. They allow you to transfer big files or
directories without hassle through e-mail. Files are split in small
e-mail messages before transmission and automatically rebuild upon
reception.

truc encapsulates the tar, gzip (or compress), uuencode, split, mail
unix commands to send big files through e-mail. untruc uses csplit,
cat, uudecode, gunzip, tar to restore the original file at the other
end.

Upon reception the messages need to be concatenated in one big file
which is auto-extractible.

These scripts have been tested under Linux, IRIX and HP-UX, please
send me an e-mail if you have tested them on an another platform or if
it failed for one of the Unix I have cited here. I am also interested
in patches and suggestions. This scripts will _never_ work for MS-DOG
or Window$.

I was unable to find scripts able to transfer large binaries files
through e-mail without having to worry about tar, uuencoding and so
on, so I have created truc and untruc. I'm sure the scripts are not
perfect but they already have help me a lot...

These scripts have been written in /bin/sh to be able to run without
compilation on as many unix machines as possible.

Note: I didn't use Perl because this tool is not part of all the Unix
standard distributions.

2.0 Install 
===========

Just copy truc & untruc in a directory in your $PATH.

3.0 How to send files through e-mail
====================================

Let's say you have a file called 'toto' you want to send to your
friend john@paradise.com, you just need to type:

truc john@paradise.com toto

truc will automatically compress, uuencode, split in chunks of
90 Kb and send the file "toto" to john@paradise.com.

When John will receive its messages, he will save them in a <file>.
By typing 'sh <file>' or 'untruc <file>' (if he has it), the file toto
will be restored.

4.0 Truc options
================

usage: truc [-h] [-t val] [-l val] [[-p ext]...] [-report] [-r e-mail] [-m] 
            [-n] [-v] [-d] [-q] [-z] [-bz] [-x] e-mail[,...] <file|dir> 

truc has the following options:

-h        : Get this help
-t val    : Sleep val seconds between each packet sent (default=30)
-l val    : value is the maximum number of lines for a packet
            (default 1500 lines, this is about 90 Kb per packet)
-k val    : value is the maximum size of a packet in Kb (default 90 Kb)
-p val    : Will mail only the specified packet (1, 2, 3, etc.)
            you can have more than one -p option in the command line.
            Warning: This option is not working when sending directories.
-report   : Will mail a report (default=no report mailed)
-r e-mail : Will mail a receipt to e-mail upon 'untruc' completion.
-m        : Will prompt the user for a mail to be sent with the packages
-n        : Seems to do all the job BUT doesn't send anything
-v        : Turn on verbose mode
-d        : Turn on debug mode
-q        : Send will be totally quiet (no message displayed)
-z        : Force the use of compress instead of gzip
-bz       : Force the use of bzip as compressor
-x        : Upon reception, contents will be extracted as far as possible.
e-mail    : E-mail address were you want to mail your file or directory.
            You can provide more than one address if you separate then
            by a comma
file|dir  : Name of the file or directory you want to send

In function of the type of file or the extension in its name, only
some operations will be performed during the truc operation:

+-----------+-----+---------------+----------+
|           | tar |    compress   | uuencode |
+-----------+-----+---------------+----------+
| directory |  X  |       X       |    X     |
| .*        |  X  |       X       |    X     |
| .tar      |     |       X       |    X     |
| .gz       |     |               |    X     |
| .bz       |     |               |    X     |
| .taz      |     |               |    X     |
| .Z        |     |               |    X     |
| .cr       |     |               |    X     |
| .crypt    |     |               |    X     |
| .uu       |     |               |          |
+-----------+-----+---------------+----------+

truc is looking for 'gzip' command and if not found, it will use the
'compress' command instead. The -z flag will force the use of compress
even if gzip is present.

You can put your favorite options in $HOME/.trucrc, for example, my
$HOME/.trucrc contains the following line: '-v -k 1000 -t 2'. Only the
first line of $HOME/.trucrc is interpreted when starting truc. These
default options are overidden by command line options.

5.0 untruc options
==================

usage: untruc [-h] [-x] [-v] [-d] [-q] [-r {yes|no} ] filename [filename2 ...]

untruc have the following options:

-h       : Get this help
-x       : To extract as far as possible the content of the received file
           (i.e., .gz will be gunzipped, .tar untarred, etc.)
-v       : Verbose
-d       : Debug (Will print some debug message)
-q       : untruc will be totally quiet (no output message)
-r yes   : If sender ask for a receipt, it will be automatically sent.
-r no    : No receipt will be sent in any case.
filename : Files to process (at least one)

When getting all the chunks in your mailbox, you just have to save
them in one or many files and then 'apply' /bin/sh on these files.
When saving messages ordering is unsignificant. You don't have to call
untruc directly but you can use it instead of /bin/sh.

The number of chunks you can save in each file is limited to 99. If
your transfer is chopped in more than 99 chunks, save them in more
than one file. This limitation is due to the csplit command. GNU
csplit have an option go around this problem but not everybody is
using GNU csplit. :-)

The -x option allow to extract the received file. For example if you
receive a .tar.gz file, untruc will 'gunzip' and 'untar' it.

-x use the filename extension to work. You will find below the
commands used for each type of files:

*.gz         : gzip -d
*.bz         : bzip -d
*.Z          : uncompress
*.cr *.crypt : crypt
*.pgp        : pgp
*.tar        : tar xf

untruc can also be used on normal uuencoded files. That's nice when
you want to extract in one go a .tar.gz.uu file (see option -x).

You can put your favorite options in $HOME/.untrucrc, for example, my
$HOME/.untrucrc contains the following line: '-d -r yes'. Only the
first line of $HOME/untrucrc is interpreted when starting untruc. These
default options are overidden by command line options if any.

6.0 Contact
===========

If you have some problems in using truc or untruc you can send me an
e-mail (segonds@ensg.u-nancy.fr). I would like to receive some bug 
reports as well.

If you think that some improvements can be made, once again, you just
have to tell me. That's how these scripts are slowly evolving.

Last version of truc and untruc can be found at the following URL:
http://www.ensg.u-nancy.fr/~segonds/truc

7.0 Acknowledgements
====================

I would like to thank Jol, Fabien, Pierre and Philippe who have
helped me to improve and debug the truc and untruc scripts (or their
ancestors the send and receive scripts). Many thanks to Nat who is
never statisfied and help me to improve this product a lot. :-)

8.0 Known bugs and limitations
==============================

If you don't use gzip, truc will use compress but if the compressed
file is larger then the original, compress will return a 2 error code
and truc will fail.

For untruc, there is apparently a limitation in the number of packets
you can save in each file (up to 99). If your transfer uses more than
99 chunks, save them in more than one file. This limitation is due to
the csplit command. Problem solved by GNU csplit but not everybody is
using it.

9.0 Conclusion
==============

I hope you will enjoy using these scripts. They are probably not
perfect (such as my English) but they can be useful sometimes.

By the way, truc means "Transfert Rapide Uuencod Compress" in
French.

*** End of README file, Version 1.0.6 ***
