#!	/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.
#
#
#	kermit - 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
	set mode = "-s"
else if( $x == "b" || $x == "binary" ) then
	set mode = "-is"
else
	echo '*** You must enter "a", "b", or "q".'
	echo " "
	goto retry
endif
#
if( -r ~/.kermrc ) then
	kermit $mode $filename
else
	kermit -y $MENU_LIB/kermrc $mode $filename
endif
