#################
# ezmlm-archive #
#################

prompt "ezmlm-archive:        "

mv "$DIR"/num "$DIR"/xnumx
${EZBIN}/ezmlm-archive "$DIR" >"$ERR" 2>&1 \
&& fatal 'succeeded when "num" was missing'

test -e "$DIR"/num && fatal 'recreated the "num" file'
test -e "$DIR"/archive/authors \
	-o -e "$DIR"/archive/lock \
	-o -e "$DIR"/archive/subjects \
	-o -e "$DIR"/archive/threads \
	-o -e "$DIR"/archnum \
&& fatal 'created files after failing'

mv "$DIR"/xnumx "$DIR"/num
${EZBIN}/ezmlm-archive "$DIR" >"$ERR" 2>&1 \
|| fatal 'failed after "num" was restored'

test -e "$DIR"/archive/authors \
	-a -e "$DIR"/archive/lock \
	-a -e "$DIR"/archive/subjects \
	-a -e "$DIR"/archive/threads \
	-a -e "$DIR"/archnum \
|| fatal 'failed to create index files'

echo "OK"
