F.45 CtreeFlushFile
Force c-tree Plus and system file buffers to disk.
Short Name
CTFLUSH
TYPE
Low level function
DECLARATION
COUNT CtreeFlushFile(COUNT filno)DESCRIPTION
CtreeFlushFile writes cache to disk. If filno is -1, the buffers for all open files are flushed. Otherwise, the buffers for the file number specified are flushed. CtreeFlushFile attempts to flush the system's file buffers after the c-tree Plus buffers are flushed.
CtreeFlushFile does not guarantee that the data on disk is consistent because other users could be updating the file at the time of the flush. Cache pages that are in the middle of an update, signified by an inability of CtreeFlushFile to acquire the update semaphore for the cache, are not flushed. The contents of the cache remain valid so subsequent I/O requests do NOT need to repopulate the cache pages.
Superfiles must be flushed as a unit. Individual members cannot be flushed separately. To flush a member of a superfile, you must flush the superfile host, which flushes ALL members. A call to CtreeFlushFile for a member of a superfile returns FMOD_ERR(48).
A call to CtreeFlushFile for an index member, instead of the host index, returns KMEM_ERR(23). That is, if an index file is opened with file number keyno, and if the index file contains two additional members, CtreeFlushFile should only be called with keyno as the argument. This will flush all the index members.
RETURN
Value Symbolic Constant Explanation 0 NO_ERROR No error occurred. 23 KMEM_ERR Attempt to flush an index member. Flush the host index. 48 FMOD_ERR Attempt to flush a superfile member. Flush the host.See Appendix A "c-tree Plus Error Codes" of the c-tree Plus Programmer's Reference Guide for a complete listing of valid c-tree Plus error values.
LIMITATIONS
Superfiles and index host/member files must be flushed as a unit. Individual members cannot be flushed separately. Flush the host file to flush all hosted files.
|
FairCom Corporation www.faircom.com |