xbin is great, but it could be even better...

xbin is great, but it could be even better...

Post by he.. » Mon, 02 Apr 1990 14:55:00



--------

xbin is a marvelous tool.  I have not used BinHex since discovering xbin.
The following are two suggestions for making xbin even better:

1.  When xbin converts a file, it should issue a message reporting the filename
    of the result.  Since it currently does not do this, it is necessary to ls
    the directory to determine the name of the result, so it can be macput.

    Alternatively, there could be a switch so that xbin would perform a macput
    immediately after converting the file.

2.  Currently, when a program is too big to send as a single posting and must
    be split, each recipient must manually edit the file to remove the headers.
    I don't know if it is possible (perhaps an expert could enlighten me), but
    it would be very nice if xbin could detect "--- End of Part n ---" or some
    other character (or sequence of characters) which would normally never
    occur, and suspend the xbin operation until the "---" signifies the next
    piece.

I hope that the person or people who wrote/maintain xbin read these suggestions
and feel suitably inspired to update the program.  I (and probably many other
xbin users) would appreciate it.

                                  --- Herb Weiner (...!tektronix!midas!herbw)

 
 
 

xbin is great, but it could be even better...

Post by ear.. » Mon, 02 Apr 1990 19:54:00



>     ...there could be a switch so that xbin would perform a macput
>     immediately after converting the file.

Try putting the following in your .cshrc...

alias send 'macput `xbin -l \!* |grep macname|tr -d \: |sed s/macname.//|tr \\40 _;xbin \!*`'
alias list 'xbin -l \!* '

Here's the first line again, broken so it fits into the terminal width for
reading:

alias send 'macput `xbin -l \!* |grep macname|\
        tr -d \: |sed s/macname.//|tr \\40 _;xbin \!*`'

Invocation:  'send file.hqx'
               xbin the file and macput it right away
             'list file.hqx'
               short summary of what's in it

I don't claim that the first one is the best way to do it, in fact it
probably is not.  It's just something I whipped up after reading Herb's
posting.  (I did test it, seemed to work.)  These both take advantage
of the -l switch in xbin which causes it to read the header from the
binhex file and print it out.  

Here is a summary of how it works:

I know what the line containing the Mac file name looks like, so I grep
for it, remove "macname: ", and then convert all blanks to underlines.
The result is the name that the xbined files will have on the host.  I
then run xbin, and if everything goes normally, macput gets the correct
file name as argv[1].

 
 
 

xbin is great, but it could be even better...

Post by str.. » Mon, 02 Apr 1990 10:03:00



> xbin is a marvelous tool.  I have not used BinHex since discovering xbin.
> The following are two suggestions for making xbin even better:
> 2.  Currently, when a program is too big to send as a single posting and must
>     be split, each recipient must manually edit the file to remove the headers.
>     I don't know if it is possible (perhaps an expert could enlighten me), but
>     it would be very nice if xbin could detect "--- End of Part n ---" or some
>     other character (or sequence of characters) which would normally never
>     occur, and suspend the xbin operation until the "---" signifies the next
>     piece.

I have written a little program which does this.  I call it bhcomb.  It
is written in c under Sys V.  It is pretty simple, and works.  Its
capability of traversing files should be incorporated into xbin, but that's
another matter.  I routinely use bhcomb under a simple shell script to
turn multiple binhexed binaries into one file for xbin.

BTW, bhcomb validates BinHex lines as opposed to looking for "--- End of
..." delimeters.

I was going to post this to the net, but it was ~4K, and I posted it
about a month ago.  I'll repost it if I get enough requests.

--
Rich Straka     ihnp4!ihlpf!straka

New word for the day: arithmoquinification.  Use it *every* day.

 
 
 

xbin is great, but it could be even better...

Post by ear.. » Mon, 02 Apr 1990 21:55:00



>     ...there could be a switch so that xbin would perform a macput
>     immediately after converting the file.
>     ...

If you put the following two lines in your .cshrc, you can use them
to a) determine the base of the filename that the ".info, .etc" files
will have after xbin is used on the binhexed file and b) xbin the
file, send it to your Mac using macput, prompt you for permission
to delete the xbined files afterwards.  Use of these aliases keeps
your disk usage down, since only the binhexed file exists on the
UNIX file system for any appreciable length of time.  This keeps
system managers friendly.

Usage:
     a) macname file.hqx
     b) macdl file.hqx

alias macname 'xbin -l \!*|grep macname|tr \\40 _|sed s/macname._//'
alias macdl 'xbin \!*;macput `macname \!*`;rm -i `macname \!*`.*'

-----------------------------------------------------------------------------
Copyright 1987 by Earle R. Horton, B.Sc.  All Rights Reserved.  This material
may be redistributed only where such redistribution is without charge and
without restrictions on further redistribution.  Incorporation of this
material in a compilation or other collective work constitutes permission
from the intermediary to all recipients to freely redistribute the entire
collection.  All other uses are prohibited.
-----------------------------------------------------------------------------

 
 
 

xbin is great, but it could be even better...

Post by how.. » Mon, 02 Apr 1990 21:43:00


I should have posted this eons ago.  Here at the old Corporation, I have been
grabbing up the various net goodies and been archiving them for our users
out on disk for some time now.  As a rule, I strip off any preamble for a
description file in the directory, get rid of anything that isn't binhex
(that include the blank line after the line saying "convert me with binhex4.0")
and I compress the file; thereby creating say, DiskInfo1.43.Z, in an appropriate
directory.

When users wish to download something, they typically use MacTerminal or
the highly praised Versaterm emulators and execute the following script
which I have called Zacput on the mainframe (yes I mean mainframe).

So here is the script, its real raw, I wrote it ages ago, it worked, I never
bothered to improve it.  I was going to enhance it to recognize pack files
("z" suffix) but never found the need.  If someone wants to make improvements
and ship it back out to everyone, mail it back and I will act as the clearing
house.  I place it in the Public Domain (magnanimous of me, eh).

--------------cut cut cut cut OUCH! #$%&*& damn scissors -----------------------
:
# Shellscript for transmitting a file(s) to a Macintosh via macput.
# File is in compress format (.Z); is unpacked, xbin'ed and macput
# Upon termination of the operation, the Macintosh bell will ring
#       two times.
#
if [ $# = 0 ] ; then
   echo "$0: expected the filename of a compress(1) file as an argument"
   exit 1
fi
owd=`pwd`
mkdir /usr/mac/tmp/$$ || exit 1
for f in $*
    do
    f=`basename $f .Z`
    if [ $f = "-" ] ; then
       echo "$0: does not accept compress(1) files from standard input, continuing"
    elif [ ! -r $f.Z ] ; then
       echo "$0: could not find $f.Z, continuing"
    elif zcat $f | ( cd /usr/mac/tmp/$$ ; xbin -n $f - 2>/dev/null ) ; then
       cd /usr/mac/tmp/$$
       echo "Now sending the binary file: $f"
       mesg n
       /usr/mac/bin/macput $f
       mesg y
    else
       zcat $f > /usr/mac/tmp/$$/$$.text
       cd /usr/mac/tmp/$$
       echo "Now sending the text file: $f"
       mesg n
       /usr/mac/bin/macput -u -n $f /usr/mac/tmp/$$/$$.text
       mesg y
    fi
    cd $owd
    done
    rm -rf /usr/mac/tmp/$$
ascii bel bel
# ------------------------- End Of Script --------------------------------------
--
"Plan for the future because that's where you                Howard C. Simonson
    are going to spend the rest of your life." {hplabs,ihnp4,nsc}!amdahl!howard
         - Mark Twain -

[ The disclaimer for this message may be found in my next article ]

 
 
 

1. StuffIt and xbin: Better than you thought

Since my posting about a couple of comp.binaries.mac postings
being bad, I've gotten a couple of messages from people telling
me what I should be using to convert stuff.

These messages ignore a couple of facts about xbin and StuffIt,
which I think are worth pointing out.

xbin has an option (-b) that for all practical purposes makes
it the equivalent of mcvert.

StuffIt is capable of decoding (and encoding) BinHex 4.0 files (except
for some very strange special case that breaks).  It is also
capable of unpacking PackIt format files.

The corrupted postings we got here are definitely corrupted.  The
last two lines of the TappyType posting are as follows:

        6B!KJ!4+#!!X5X+!"#b*3)"Qk,,LIJ`iXf#'((J,"Rhm!`L!JJ3BLU+#$$6iBiB3
        9ATLKJaZ'm+'0)B))$DL%J3-R$j8mF-U!!)(#6J`A-Q+ND)!L$!JhEqLd+$

There's no trailing : and no trailing --- line (and Roger is
pretty consistent about doing this kind of thing).

In any case, could someone send me the TappyType and StackDoc
postings?

--
David Elliott

(408)944-4073
"You can lead a robot to water, but you can not make him compute."

2. PAS-16 and Os/2 Beta HELP!

3. I am trying to order Apple II startup disk for my IIc. Am kid, will pay.

4. Can't convert Word files anymore

5. What am I missing with Ultima3

6. NEED PICTURES OF AMIGAS!

7. I am serious.

8. SUMMARY: scanning software for Sun

9. Here I am!

10. Am looking for the following in .DSK format (or .NIB *grin*)

11. Bids for Apple GS misc - Mon am update

12. Art and all that Jazz: i am bimonthly lazy, so I believe you

13. I am serious.