FileServerFileCopy

Copies a file, or a portion of a file, to another file

Local Servers:blocking
Remote Servers:blocking
NetWare Server:3.x, 4.x, 5.x, 6.x
Platform:NLM
Service:File System

Syntax

   #include <nwfinfo.h>  
    
   int FileServerFileCopy  (  
      int    sourceFileHandle,   
      int    destinationFileHandle,   
      LONG   sourceFileOffset,   
      LONG   destinationFileOffset,   
      LONG   numberOfBytesToCopy,   
      LONG  *numberOfBytesCopied); 
   

Parameters

sourceFileHandle

(IN) Specifies the file handle of the source file.

destinationFileHandle

(IN) Specifies the file handle of the destination file.

sourceFileOffset

(IN) Specifies the offset (in bytes) in the source file where copy should begin.

destinationFileOffset

(IN) Specifies the offset (in bytes) in the destination file where the data should be copied.

numberOfBytesToCopy

(IN) Specifies the number of bytes to be copied.

numberOfBytesCopied

(OUT) Points to the number of bytes actually copied.

Return Value

0

0x00

ESUCCESS

1

0x01

ERR_INSUFFICIENT_SPACE

22

0x16

EBADHNDL

131

0x83

ERR_NETWORK_DISK_IO

136

0x88

ERR_INVALID_FILE_HANDLE

147

0x93

ERR_NO_READ_PRIVILEGE

148

0x94

ERR_NO_WRITE_PRIVILEGE_OR_READONLY

149

0x95

ERR_FILE_DETACHED

162

0xA3

ERR_IO_LOCKED

Remarks

An application must pass file handles in the sourceFileHandle and destinationFileHandle parameters. A file handle can be obtained by calling the open, sopen, creat, or fileno function.

To copy from the beginning of the source file to a new file, set the sourceFileOffset and destinationFileOffset parameters to 0x00.

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

The numberOfBytesCopied parameter returns the number of bytes copied between files as a result of calling this function.

See Also

creat, fileno, open, sopen (Single and Intra-File Services)