Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FUNCky - <b>name:</b> <b>fcopybyte() - copy <nn> bytes from <file 1> to <file 2></b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Name:     fcopybyte() - copy <nn> bytes from <file 1> to <file 2>
  Usage:    <integer> = fcopybyte(<handle1>,<handle2>,[<bytes>])
  Params:   integer <handle1> - handle of the file to copy from
            integer <handle2> - handle of the file to copy to
            integer <bytes> - number of bytes to copy starting at
            the current file position pointer. If left off, then all
            bytes till the end of <file 1> are copied to <file 2>.
  Returns:  total number of bytes copied, or -1 for error

 ---------------------------------- Example ---------------------------------

                 handle1 = fopen("test.txt")
                 handle2 = fcreate("newtest.txt")
                 fseek(handle1,50)
                 numbytes = fcopybyte(handle1,handle2,50)

                 if (numbytes < 50)
                      ? "Error Copying data...."
                 else
                      ? str(numbytes)+" Bytes copied...."
                 endif

  Note:     If an IO error occurs during copying, the destination file
            is not erased. If you specify to copy more bytes than are
            available in <handle1> then all bytes till the end of
            <handle1> are copied to <handle2> and that number is
            returned.


See Also: fcopy() ferror()

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