Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FlexFile Reference Guide - <b>v_set_commit()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 V_SET_COMMIT()
 Set DOS buffer flushing automatically on/off
-------------------------------------------------------------------------------
 Syntax

    V_SET_COMMIT( [<lToggle>] )   ->   lOldSetting

 Arguments

    <lToggle> is a logical expression which, if true, will turn on
    automatic buffer flushing.  If false,  it will turn off automatic
    buffer flushing.  If omitted, no change will be made and the
    function can be used simply to query the current setting.  The
    default state is ON.

 Returns

    V_SET_COMMIT() returns the old setting of the switch.

 Description

    DOS "buffers" disk I/O in order to speed up disk access.  The
    downside to this feature is that the data in the buffers can be
    lost if the machine "hangs" or is powered down before the buffers
    are copied to disk.  This problem was addressed in DOS version 3.3
    and later by allowing a call which forces DOS's buffers to be
    written to disk.  V_SET_COMMIT() sets DOS buffer flushing on
    automatic if a logical (.T.) is passed or turns off the automatic
    buffer flushing if a logical (.F.) is passed.  In the latter case,
    use V_COMMIT() to flush buffers manually.

       +------------------------ WARNING -------------------------+ 
       | V_COMMIT and V_SET_COMMIT() are based on functions       | 
       | provided in DOS 3.3 and later.  Calls made to these      | 
       | functions on an earlier version of DOS will have no      | 
       | affect.                                                  | 
       +----------------------------------------------------------+ 

 Example

    // Turn off automatic flushing in order to speed up operation.
    V_USE( "temp" )
    V_SET_COMMIT(.f.)

    DO WHILE !EOF()
       IF DELETED()
          REPLACE vlf_fld WITH V_DELETE( vlf_fld )
       ENDIF
       SKIP
    ENDDO
    PACK

    // Flush the buffers and turn automatic flushing back on.
    V_COMMIT()
    V_SET_COMMIT(.T.)

See Also: V_COMMIT()

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