#!	/bin/csh -f
#
# Copyright 1993, 1994, 1995 by the Regents of the University of California.
# see the file "Copyright" in the distribution for conditions of use.
#
#
#	zmodem - downloading
#
#	get file name and binary/ascii from user
#
echo -n "Enter file name: "
set filename = $<
set y = ( $filename )
if( $#y == 0 ) exit
#
foreach i ( $y )
	if( ! -e $i ) then
		echo "*** File $i does not exist."
		exit
	endif
	if( ! -f $i ) then
		echo "*** File $i is not a regular file."
		exit
	endif
end
#
echo " "
echo "Is this an ASCII or a binary file? "
retry:
echo -n 'Enter "a" for ASCII, "b" for binary, "q" to quit: '
set x = $<
set y = ( $x )
if( $#y == 0 || $#y > 1 ) set x = "ERR"
if( $x == "q" ) exit
if( $x == "a" || $x == "ascii" ) then
	sz -a $filename
else if( $x == "b" || $x == "binary" ) then
	sz -b $filename
else
	echo '*** You must enter "a", or "b", or "q".'
	echo " "
	goto retry
endif
