I am downloading the a1027a.ern file using ZModem to a mapped network drive X:\835_incoming\, which it does nicely, but I need to "move" the file to another directory X:\ADIR\ on the same networked drive.
What am I missing here? Copyfile and delfile don't work. Thanks for your gentle help!
ammco
;Call from main:
#define ADir "X:\ADIR\"
string sFilename = "a1027a.ern"
string szBBS = "ERA"
pCopyFile(szBBS, sFileName)
;---------------------------------------------------------
proc pCopyFile
param string sBBS
param string sSrcFile
string szMsg, sSource, sDestination
string sSrcDir = "X:\835_incoming\"
strfmt sSource "%s%s" sSrcDir sSrcFile
switch sBBS
case "ERA"
strfmt sDestination "%s%s" ADir sSrcFile
logit(sSource) ;X:\835_incoming\A1027A.ERN
logit(sDestination) ;X:\ADIR\A1027A.ERN
if findfirst sSource
strfmt szMsg "sSource is [%s]" sSource
logit(szMsg)
;sSource is [X:\835_incoming\A1027A.ERN]
if copyfile sSource sDestination
delfile sSource
else
strfmt szMsg "Could not copy [%s] to [%s]" sSource sDestination
logit(szMsg)
;Could not copy [X:\835_incoming\A1027A.ERN] to [X:\ADIR\A1027A.ERN]
endif
else
strfmt szMsg "did not find it"
logit(szMsg)
endif
endcase
endswitch
endproc
What am I missing here? Copyfile and delfile don't work. Thanks for your gentle help!
ammco
;Call from main:
#define ADir "X:\ADIR\"
string sFilename = "a1027a.ern"
string szBBS = "ERA"
pCopyFile(szBBS, sFileName)
;---------------------------------------------------------
proc pCopyFile
param string sBBS
param string sSrcFile
string szMsg, sSource, sDestination
string sSrcDir = "X:\835_incoming\"
strfmt sSource "%s%s" sSrcDir sSrcFile
switch sBBS
case "ERA"
strfmt sDestination "%s%s" ADir sSrcFile
logit(sSource) ;X:\835_incoming\A1027A.ERN
logit(sDestination) ;X:\ADIR\A1027A.ERN
if findfirst sSource
strfmt szMsg "sSource is [%s]" sSource
logit(szMsg)
;sSource is [X:\835_incoming\A1027A.ERN]
if copyfile sSource sDestination
delfile sSource
else
strfmt szMsg "Could not copy [%s] to [%s]" sSource sDestination
logit(szMsg)
;Could not copy [X:\835_incoming\A1027A.ERN] to [X:\ADIR\A1027A.ERN]
endif
else
strfmt szMsg "did not find it"
logit(szMsg)
endif
endcase
endswitch
endproc