![[About]](r:\html\lsrxabout.gif)
![[Toc]](r:\html\lsrxtoc.gif)
0.9b (c) 1995 Peter Childs
Performs a remote file copy on a server.
Syntax
MyRc = NetMisc(NETREMOTECOPY, SrcPath, DestPath, 'VarInfo')
Parameters
The parameters required and returned are:
SrcPath The redirected source path
DestPath The redirected destination path
'VarInfo' which is divided into:
o VarInfo.openflags
Controls the file open (a decimal value).
The file open options defined as follows:
Bit Meaning
--- -------
0-1 Used if destpath exists. If 0, the open fails; if 1,
the file is appended; and if 2, the file is overwritten
2-3 Reserved, with a value of 0.
4 Used if destpath does not exist. If 0, the open fails;
if 1, the file is created
5-15 Reserved, with a value of 0.
The value must be converted to decimal before the function call. The
default value is 0x0012 which is equal to 18 in decimal
o VarInfo.copyflags
Controls the copy options expressed in decimal.
File copy options defined as follows:
Bit Meaning
--- -------
0 If 1, destpath must be a file. If bit 0 is set to 1,
bit 1 must be 0
1 If 1, destpath must be a directory. If bit 1
is set to 1, bit 0 must be 0
2 If 0, destpath is opened in binary mode. If 1,
destpath is opened in text mode
3 If 0, sourcepath is opened in binary mode. If 1,
sourcepath is opened in text mode
4 If 1, all writes are verified
5-15 Reserved.
The value must be converted to decimal before the function call. The
default value is 0x0011 which is equal to 17 in decimal
o VarInfo.ci_num_copied
The number of files copied
o VarInfo.ci_err_buf
The string buffer containing error information of the copy operation
Example
/* Perform Net remote copy */
call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs'
call LoadLsRxutFuncs
NETREMOTECOPY = 670
SrvName = '\\KING_BALU'
SrcPath = 'Y:\CONFIG.SYL'
DestPath = 'Y:\CONFIG.BAC'
VarInfo.openflags = x2d('0012')
VarInfo.copyflags = x2d('0011')
myRc = NetMisc(NETREMOTECOPY, SrcPath, DestPath, 'VarInfo', SrvName)
if myRc <> '0' then do
say 'Got error from NetMisc() ' myRc
rcCode = 9
end
else do
say 'Number files copied ' VarInfo.ci_num_copied
say 'Error Information ' VarInfo.ci_err_buf
rcCode = 0
end
call DropLsRxutFuncs
call RxFuncDrop 'LoadLsRxutFuncs'
exit rcCode
Example Output
Number files copied 1 Error Information
Inf-HTML End Run - Successful