The NetRemoteCopy API copies one or more files from one location to another on a remote server.
Restrictions
This API can be called from OS/2 workstations, but both the source and destination drives must be redirected drives. (See the sourcepath and destpath parameters for a description.)
#include <netcons.h> #include <remutil.h> NetRemoteCopy(sourcepath, destpath, sourcepass, destpass, openflags, copyflags, buf, usBuflen); /* 16 bit */ Net32RemoteCopy(sourcepath, destpath, sourcepass, destpass, openflags, copyflags, buf, ulBuflen); /* 32 bit */Parameters
See Common Parameter Definitions for descriptions of parameters not defined here.
sourcepath
The following table lists the return codes most significant to this API.
(See API Return Codes for a complete
list of return codes.) ┌─────────────────────────────┬───────┬────────────────────────────────────────┐│SYMBOLICCONSTANT
│VALUE│MEANING │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_Success │ 0 │ No errors were encountered. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_FILE_NOT_FOUND │ 2 │ The file was not found. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_PATH_NOT_FOUND │ 3 │ The path was not found. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_ACCESS_DENIED │ 5 │ Administrator privilege is required. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_NO_MORE_FILES │ 18 │ No more files are available. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_SHARING_VIOLATION │ 32 │ A sharing violation occurred. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_FILE_EXISTS │ 80 │ The file already exists. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_INVALID_PARAMETER │ 87 │ At least one parameter value is not
│
│ │ │ valid. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_NetNotStarted │ 2102 │ The redirector NETWKSTA.200 has not
│
│ │ │ been started. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_BufTooSmall │ 2123 │ The buffer is too small for fixed- │
│ │ │ length data. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_OS2IoctlError │ 2134 │ An internal error occurred when │
│ │ │ calling the workstation driver. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_WkstaNotStarted │ 2138 │ The Requester service has not been
│
│ │ │ started. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_SourceIsDir │2380 │Thesourcepathcannotbeadirectory
.│
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_BadSource │ 2381 │ The source path is not valid. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_BadDest │ 2382 │ The destination path is not valid. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_DifferentServers │ 2383 │ The source and destination paths are
│
│ │ │ on different servers. │
└─────────────────────────────┴───────┴────────────────────────────────────────┘
Other codes could be returned from the following functions:
Currently, the source and destination for the file copy must be on the same server, or an error results. The following cases are valid:
For information about: