Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Novlib 3.30 Online Reference - <b> filnetcopy()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 FilNetCopy()
------------------------------------------------------------------------------
 Purpose:
 Network copy a byte range from one file to another.

 Syntax:
 FilNetCopy( lpszSource, lpszDest, dwSourceOff, dwDestOff ,dwLength )

 Parameters:
 lpszSource  The full path and name of the source file.
 lpszDest    The full path and name of the destination file.
 dwSourceOff The offset into the source file to start copying from.
 dwDestOff   The offset into the destination file to begin copying to.
 dwLength    The number of bytes to copy.

 Returns:
 A numeric value (unsigned long int).

 The CA-Clipper name for this function is:
 FilNetCpy()

 Description:
 FilNetCopy() copies a range of bytes from a source file, specified by
 lpszSource to a destination file specified by lpszDest. Both lpszSource
 and lpszDest must be the full NetWare path and file name including the
 volume, e.g.: SYS:DATA\KATIE\SOURCE.DBF.

 lpszSource must be an existing file on the network, lpszDest can be an
 existing file, or, if it does not exist, FilNetCopy() creates lpszDest as a
 new file. dwSourceOff is the starting offset into the source file from
 which to start copying. dwDestOff is the offset in the destination file to
 start copying to, normally 0. dwLength is the number of bytes to copy from
 the source file to the destination file. If dwLength is specified as
 NOVDEFLONG, FilNetCopy() will use the length of the source file.

 FilNetCopy() returns the actual number of bytes that were copied, or
 NOVERRLONG if an error has occurred.

 FilNetCopy() is considerably faster than an ordinary copy, because the copy
 takes place on the file server, and none of the data is transferred to or
 from the workstation.

 Example:
 // To network copy file SYS:DATA\KATIE.DBF to SYS:DATA\KATIE.BAK:

 dwNumOfBytes = FilNetCopy("SYS:DATA\KATIE.DBF","SYS:DATA\KATIE.BAK",;
                0, 0, NOVDEFLONG)
 if( dwNumOfBytes != NOVERRLONG )
    ? dwNumOfBytes, " Copied."
 endif

 // To append file SYS:DATA\WORK.TXT onto the end of file
 // SYS:DATA\WORK.OLD:
 // get length of destination file

 iHandle = fopen( "SYS:DATA\WORK.OLD", FO_READ )
 iLength = fseek( iHandle, FS_END )
 fclose( iHandle )

 // append source file to it

 dwNumOfBytes = FilNetCopy( "SYS:DATA\WORK.TXT",;
  "SYS:DATA\WORK.BAK", 0, iLength, NOVDEFLONG )
 if( dwNumOfBytes != NOVERRLONG )
    ? dwNumOfBytes," Copied"
 endif

 Notes:
 This function only works with files on a network volume, and
 requires the appropriate trustee rights.

See Also: DirSubDirList() DirFileList()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson