NWFileServerFileCopy(3nw)


NWFileServerFileCopy -- copies a file or portion of a file from a source to a destination on the same NetWare server

Synopsis

   #include<nwfile.h> 
   or 
   #include <nwcalls.h> 
   

NWCCODE N_API NWFileServerFileCopy (NWFILE_HANDLE srcFileHandle, NWFILE_HANDLE dstFileHandle, nuint32 srcOffset, nuint32 dstOffset, nuint32 bytesToCopy, pnuint32 bytesCopied);

Description

The parameters are as follows:

srcFileHandle
(IN) Specifies the source file handle (index).

dstFileHandle
(IN) Specifies the destination file handle (index).

srcOffset
(IN) Specifies the offset, in the source file, where the copying is to begin.

dstOffset
(IN) Specifies the offset, in the destination file, where the copying is to begin.

bytesToCopy
(IN) Specifies the maximum number of bytes to copy.

bytesCopied
(OUT) Points to the number of bytes actually copied, or the size of a new destination file (optional).

Return values

0x0000
SUCCESSFUL

0x0006
Invalid File Handle

0x8830
NOT_SAME_CONNECTION

0x8901
ERR_INSUFFICIENT_SPACE

0x8983
IO_ERROR_NETWORK_DISK

0x8988
INVALID_FILE_HANDLE

0x8993
NO_READ_RRIVILEGES

0x8994
NO_WRITE_PRIVILEGES_OR_READONLY

0x8995
FILE_DETACHED

0x8996
SERVER_OUT_OF_MEMORY

0x89A2
READ_FILE_WITH_RECORD_LOCKED

Notices

If the source and destination files do not reside on the same server, NOT_SAME_CONNECTION is returned.

An application must pass OS file handles in srcFileHandle and dstFileHandle. The application should use the appropriate OS functions that create and open files to return the file handles, depending on whether the destination file is a new or an existing file.

If the destination file is new, bytesCopied points to the size of the destination file. Otherwise, bytesCopied points to the number of bytes copied.

To copy the entire source file, specify a value that matches or exceeds the file size in bytesToCopy.

NWFileServerFileCopy is very efficient since the data does not come to the workstation; the server handles the duplication of the data internally.

Under OS/2, the given handles are converted to NetWare handles via the NetWare IFS.

Under DOS, NWFileServerFileCopy is a direct call to the shell, and the shell handles the copy.

Services

File Systems

NCP calls

0x2222 74
Copy From One File To Another

30 January 1998
© 1998 The Santa Cruz Operation, Inc. All rights reserved.