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>fcopy() - copy a file</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Name:     fcopy() - copy a file
  Usage:    [<integer>] = fcopy(<file1>,<file2>)
  Params:   string <file1> - file name to copy from
            string <file2> - file name to copy to
  Returns:  integer equaling total bytes copied, or -1 for error

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

                 if isdrive("A:")
                      fcopy("test.txt","A:test.txt")
                 endif

                 count = filecount("*.prg")
                 if (count < 1)
                      return
                 endif

                 tempfile = findfirst("*.prg")
                 for x = 1 to count
                      ? "Copying file: "+tempfile
                      fcopy(tempfile,"A:"+tempfile)
                      tempfile = findnext()
                 next
                 ? "All files copied to A:...."

  Note:     Fcopy() will not accept wild cards. the full filename
            must be specified by both parameters. If an IO error
            occurs during copying, the destination file is erased
            before fcopy() terminates just like DOS.


See Also: fcopybyte() ferror()

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