#include <revolution/vf.h>
typedef s32 VFErr;
extern VFErr VFBuffering( const char* drive, s32 mode );
extern VFErr VFBufferingW( const VFWchar* drive, s32 mode );
drive |
Drive name to set the write mode. | ||||||||
mode |
Write or Write Back Mode Set to VF_WRITE_BACK_ON_SIGNIF_API by default when VF starts.When a drive is formatted, the target drive is set to the default setting, VF_WRITE_BACK_ON_SIGNIF_API.
|
Returns 0 when successful
Otherwise, returns VFErr other than 0
Sets the write mode and write-back mode for the FAT buffer and data buffer.
The FAT buffer is the region used internally by VF for caching the data of the FAT region when reading from or writing to FAT. The data buffer is the region used internally by VF for caching the file data and directory entry regions when reading from or writing to the file data and directory entry regions.
You can select whether to write data that has been updated when an API is issued immediately to the media when a directory entry has been updated with VFCreateFile or VFOpenFile, or when data has been updated with VFReadFile or VFWriteFile.
Depending on the VF internal processing, the FAT buffer and the data buffer may sometimes be swapped.
When this happens, write-back to the FAT buffer or data buffer will occur, regardless of the write-back setting.
When a drive that has been set to a write mode other than VF_EJECT_SAFE_WITH_WRITE_THRU is set to VF_EJECT_SAFE_WITH_WRITE_THRU, the data cached in the FAT buffer or the data buffer is written back. If the write-back process fails at this time, the write mode is not changed.
In addition, the state of the cache buffer is undefined because the write-back process has been interrupted.
If the write-back process fails, set the write mode to VF_EJECT_SAFE_WITH_WRITE_THRU again, and call VFBuffering.
If data cannot be written back because of some problem with the media, the write mode cannot be changed.
If a file is open in the drive specified with drive, do not call VFBuffering to change the write mode or the write-back method.
Operation cannot be guaranteed if you make these changes.
2006/11/13 Cleaned things up
2006/09/29 Initial version.
CONFIDENTIAL