+ device=/dev/fd0
+ [ "$drive" = "B" ] && device=/dev/fd1
+ [ "$drive" = "C" ] && device=${msdos_device}
+ echo;
+ if [ "$drive" != "C" ]; then
+ echo "Insert floppy in drive $drive:, then press RETURN to copy files,"
+ echo -n "or enter option (? for help): "
+ else
+ echo -n "Press RETURN to copy files, or enter option (? for help): "
+ fi
+ read answer junk
+ case "${answer:-g}" in
+ c*|C*)
+ if [ "$drive" != "C" ]; then
+ echo "Cannot change directory: not reading from MS-DOS drive C:"
+ else
+ echo
+ echo -n "Read from which MS-DOS drive C: directory? [/${subdir}] "
+ read resp junk
+ [ ! "$resp" ] && resp="/$subdir"
+ absolute=`expr X"$resp" : 'X[Cc]*:*\([/\]\)'`
+ subsub=$(echo "${resp}" | \
+ awk '{ sub(/^[Cc]*:*/, ""); gsub(/\\/, "/"); gsub(/^\/*/, ""); gsub(/\/*$/, ""); print $0 }')
+ if [ "$absolute" -o ! "$subdir" ]; then
+ newsub=$subsub
+ else
+ newsub=$subdir/$subsub
+ fi
+ if [ -d ${dir}/${newsub} ]; then
+ subdir=$newsub
+ else
+ echo "C:/${newsub}: No such directory"
+ fi
+ fi
+ ;;
+ g*|G*)
+ sync
+ if [ "$drive" = "C" ]; then
+ [ "$verbose" ] &&
+ { echo; echo "Please wait. Copying files from MS-DOS C:/${subdir}"; }
+ cp ${msdos_dir}/${subdir}/* .
+ sync
+ elif mount -t pcfs $verbose $device $dir; then
+ [ "$verbose" ] &&
+ { echo; echo "Please wait. Copying files to disk..."; }
+ cp $interactive $dir/* .
+ sync
+ umount $dir
+ tmp=$drive; drive=$altdrive; altdrive=$tmp
+ fi
+ ;;
+ i*|I*)
+ tmp=$interactive; interactive=; [ -z "$tmp" ] && interactive=-i
+ tmp=on; [ -z "$interactive" ] && tmp=off
+ echo "interactive mode is $tmp"
+ ;;
+ l*|L*)
+ sync
+ [ "$verbose" ] && echo "Directory of ${drive}:/${subdir}"
+ if [ "$drive" = "C" ]; then
+ ls -l $dir/${subdir}
+ else
+ umount $dir >/dev/null 2>&1
+ if mount -t pcfs $device $dir; then
+ ls -l $dir/${subdir}
+ umount $dir
+ fi
+ fi
+ ;;
+ o*|O*)
+ tmp=$drive; drive=$altdrive; altdrive=$tmp
+ ;;
+ q*|Q*)
+ drive=q
+ ;;
+ s*|S*)
+ echo; echo -n "tmp_dir is set to $tmp_dir"
+ [ "$tmp_dir" != "`pwd`" ] && echo -n " (physically `pwd`)"
+ echo; echo "Free space in tmp_dir:"
+ df -k .
+ echo -n "Reading from drive $drive:"
+ [ "$drive" != "$altdrive" ] && echo -n " and drive $altdrive:"
+ echo
+ tmp=on; [ -z "$verbose" ] && tmp=off
+ echo "Verbose mode is $tmp"
+ tmp=on; [ -z "$interactive" ] && tmp=off
+ echo "Interactive mode is $tmp"
+ ;;
+ v*|V*)
+ tmp=$verbose; verbose=; [ -z "$tmp" ] && verbose=-v
+ tmp=on; [ -z "$verbose" ] && tmp=off
+ echo "verbose mode is $tmp"
+ ;;
+ \?)
+ echo
+ echo "Enter: To:"
+ echo "----- ---"
+ echo "(just RETURN) Copy files from ${drive}:/${subdir} to $tmp_dir"
+ echo " c Change directory of MS-DOS drive C:"
+ echo " i Toggle interactive mode (cp -i)"
+ echo " l List directory of current drive"
+ echo " o Read from alternate floppy drive"
+ echo " q Quit"
+ echo " s Show status"
+ echo " v Toggle verbose mode"
+ echo
+ ;;
+ esac