1	extend
2	! &
	! Read a Unix tar magtape onto a RSTS disk.  One file only.	&
	! Author: Martin Minow.						&
	! &
	! Edit line 15 to change the name of the magtape (mt -> mm)	&
	! &

10	input "Input from magtape unit <0>"; mtunit%
15	indev$ = "mt" + num1$(mtunit%) + ":"
20	open "dk:tartap.dat" for output as file 2
30	open indev$ for input as file 1, recordsize 10320%
100	i% = magtape(3%, 0%, 1%)		! Rewind
1000	on error goto 19000			! Trap all errors
1010	while 1%
1020		get #1%\ i% = recount		! Read one block
1040		put #2%+swap%(1%), count i%	! Write the block
1990	next
19000	if err = 11% then print "Normal ending at EOF" else on error goto 0
19010	close 2%
32767	end
