# SYNC

Syntax:

Then: SYNC lookupname
Then: SYNC -
Then: SYNC

"lookupname" is the name of the file to sync.
use - to represent the current (main) file.
if no filename specified, all files are synched.

NOTE: Many computer systems have a write behind disk cache, where information is not immediately written to the disk, in order to help increase disk performance. Should the system crash between the time filePro writes a record and the system writes the cache, that formation is lost.

Under MS-DOS, a file's directory entry is not updated until the file is closed. If you are adding new records beyond the current end of file and do not exit filePro properly, all new records will be lost. The SYNC command forces the update of the file's directory entry.

The SYNC command allows you to have some control over when the information is written to disk. Note that indiscriminate use of the SYNC command can degrade overall system performance.

Version Ref: 4.5

Description:

Flushes any disk writes pending on a file.

Examples:

Create an audit trail record, and force it to be written from cache, and the directory entry updated:

Then: lookup audit = filename r=free -ex

Then: copy audit ; write audit ; sync audit

Even though filePro will write the record with the WRITE command, it is possible that the operating system will cache the write. Also, MS-DOS systems will not update the files directory entry to reflect the possible size change from the new record. Should the system crash before the cache is written, or filePro exits, these changes can be lost.