On Time RTOS-32 Documentation
Welcome
RTTarget-32
RTKernel-32
RTFiles-32
RTFiles-32 Programming Manual
RTFiles-32 Reference Manual
Introduction
General File I/O
Information about Files
File Attributes
Directories
Finding Files
File Name Operations
Disk and Volume Management
Function RTFResetDisk
Function RTFGetDiskInfoEx
Function RTFGetPartitionInfo
Function RTFSetVolumeLabel
Function RTFFormat
Function RTFFormatExFAT
Function RTFCheckDisk
Function RTFCheckDiskBufferSize
Function RTFCreateMasterBootRecord
Function RTFSplitPartition
Function RTFCreateGPTPartition
Function RTFSplitGPTPartition
Function RTFCreateBackupGPT
Function RTFCreateBootSector
Function RTFGetDeviceIndex
Function RTFDeviceIoControl
Function RTFPartitionSectors
Function RTFPartitionStart
Miscellaneous File Functions
Raw I/O Functions
Functions for Debugging
Device Dependent Functions
Obsolete Functions
Disk Device Driver API
MTD Device Driver API
RTFiles-32 Error Codes
Code Page Reference
RTIP-32
RTPEG-32
RTUSB-32
|
Function RTFFormatExFAT
Function RTFFormatExFAT formats a logical drive with the exFAT file system:
int RTFFormatExFAT(const char * DriveName,
UINT SectorsPerCluster,
RTFFormatCallback Progress,
DWORD Flags);
ParametersDriveNameMust be a logical drive file name in the form "\\.\X:", where "X" is replaced with the drive letter of the logical drive to be formatted.
SectorsPerClusterSpecifies the desired number of sectors per cluster. This parameter should be 0 to use a default cluster size, or a power of 2 between 1 and 65536.
ProgressA callback to supply progress information:
typedef void (__cdecl * RTFFormatCallback)(const char * DeviceName,
int Action,
DWORD Total,
DWORD Completed);
It will be called periodically by RTFFormatExFAT. Parameter Action can have one of the following values:
Value |
Meaning |
RTF_FMT_PGS_LOW_FMT |
Low-level formatting is in progress. |
RTF_FMT_PGS_HIGH_FMT |
High-level formatting is in progress. |
RTF_FMT_PGS_CLEAR_MEDIUM |
The data area of the drive is being deleted. |
Total indicates how many sectors must be processed. Completed indicates how many sectors have been processed successfully.
The Progress parameter for RTFFormatExFAT is optional and may be set to NULL.
FlagsControls various options about how to format the drive. It can be zero or any combination of the following flags:
Value |
Meaning |
RTF_FMT_FORCE_LOW_LEVEL |
This flag forces RTFFormatExFAT to do a low-level format. By default, RTFFormatExFAT will do a low-level format only if writing to the device fails. Hard disks are never low-level formatted by RTFFormatExFAT. If you need to low-level format a hard disk, use the respective raw I/O functions. |
RTF_FMT_NO_LOW_LEVEL |
Prevent RTFFormatExFAT from low-level formatting a device. If writing to the device fails, the function returns with an error. |
RTF_FMT_LARGE_BUFFER |
This flag instructs RTFFormatExFAT to temporarily heap-allocate and use a 64k disk buffer instead of its stack-allocated 512 byte buffer. RTF_FMT_LARGE_BUFFER can dramatically improve the speed of formatting and is generally recommended. This flag is mandatory for disks with a sector size larger than 512 bytes. |
RTF_FMT_NO_ALIGN |
This flag instructs RTFFormat not to align data clusters. by default, data clusters are aligned with the applied cluster size. |
RTF_FMT_ALIGN_4K |
This flag instructs RTFFormat to align data clusters on 4k byte boundaries. |
RTF_FMT_ALIGN_BUFFSIZE |
This flag instructs RTFFormat to align data clusters according to the currently used buffer size (RTF_BUFFER_SIZE), which is 4k by default but may be changed through file <Rtfdata.c>. |
return valueIf the function succeeds, the return value is RTF_NO_ERROR. If it fails, the return value is a negative error code. Demo programs RTFCmd and PartDemo use this function.
RTFFormatExFAT does not perform a surface scan on the volume. Only if writing to any system portion of the drive fails, the function returns the respective error code.
Function RTFFormat
Function RTFCheckDisk
|