FormatVolume Method
Formats a storage volume or partition with the CBFS Storage filesystem. (Windows only).
Syntax
ANSI (Cross Platform) int FormatVolume(const char* lpszVolumeName, int iFlags); Unicode (Windows) INT FormatVolume(LPCWSTR lpszVolumeName, INT iFlags);
- (void)formatVolume:(NSString*)volumeName :(int)flags;
#define MID_CBDRIVE_FORMATVOLUME 27 CBFSSTORAGE_EXTERNAL int CBFSSTORAGE_CALL CBFSStorage_CBDrive_Do(void *lpObj, int methid, int cparam, void *param[], int cbparam[], int64 *lpllVal);
Remarks
This method formats the storage volume or partition specified by VolumeName with the CBFS Storage filesystem, allowing it to be opened as a vault using the OpenVolume method.
The VolumeName parameter specifies the fully-qualified name of a storage volume or partition. DOS names, such as X:, are also valid.
The Flags parameter is used to control formatting options, and should be set by OR'ing together zero or more of the following flags:
CBFSSTORAGE_FMF_FAST_FORMAT | 0x00000001 | Perform a fast format; only initialize the pages necessary for storing the filesystem structure.
When this flag is not set, all pages of the new vault are initialized. |
Note that formatting a large storage partition or volume can take a significant amount of time, and this method will block until the formatting process is complete.
Note: This method cannot be called when Active is true, and cannot be called within events.
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)