#!/usr/bin/perl
#
# @(#)ntr3cpc		1997-11-18
#
# G. Großmann, SAP AG
#
package ntr3cpc;
use Env;
use Carp;
use File::Copy;
do "$TOOLVARS";
if ( $@ ) { print "$@"; exit }
ToolTrace("ntr3cpc called with @ARGV\n");

chdir($TMP) || die "Can't change to directory $TMP: $!";

copy("$DBROOT/sap/altkey.cpc", "./altkey.cpc") || warn "Can't copy $DBROOT/sap/altkey.cpc to ./altkey.cpc: $!";

@ARGV = ( "altkey" );
do "$TOOL/bin/ntcpclnk$TOOLEXT" || die "Can't execute $TOOL/bin/ntcpclnk$TOOLEXT: $!";
if ( $@ ) { warn "Error while executing ntcpclnk:\n", "$@"; exit }

unlink "$DBROOT/sap/altkey.exe";
rename("./altkey.exe", "$DBROOT/sap/altkey.exe") || warn "Can't rename ./altkey.exe to $DBROOT/sap/altkey.exe: $!";
unlink <altkey.*>, "$DBROOT/sap/altkey.cpc";


__END__
