FileCOpen

FileCOpen

Tests to see if the file is still open in the backup mode

Syntax

      FileCOpen() --> <lOpenFile>

Returns

<lOpenFile> : .T. when all data is not copied during a FileCopy() or FileCCont().

Description

FILE COPY OPEN

FileCOpen() determines whether all data is copied. This concerns the source file, which is specified when the FileCopy() function is called. FileCOpen() returns .T. until all the data in the source file is read, whether by FileCopy or the follow-on function FileCCont()

Note

. If you must abort the copy process, and FileCOpen() continues to returns .T., use FileCClose().

Examples

      Show a back up with FileCopy():

      nCounter   := 1                   // "BIG.001" etc.
      cTargetFile   := "BIG" + NTOC(nCounter, 10, 3, "0")
      FileCopy("BIG.DBF", "A:\" + cTargetFile, .T.)
                                        // Back up mode
      DO WHILE FileCOpen()
         DO NEXTDISK                    // Request disk change
         nCounter     := nCounter + 1
         cTargetFile  := "BIG" + NTOC(nCounter, 10, 3, "0")
         FileCCont(cTargetFile)         // Next disk - new name

      ENDDO
      FileCClose()                      // For safety

Seealso

FileCopy(), FileCCont(), FileCClose(), FileCDaTi()

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s