The fdefrag function defragments the Flash File System on the specified drive. If the drive string is empty ("") the default drive specified in the FILE_CONFIG.C configuration file is used. The following values are supported for the drive: | Drive | Description |
|---|
| "F:" | Embedded Flash drive. | | "S:" | SPI Flash drive. | | "R:" | Ram drive. |
During defragmentation, the fdefrag function reorganizes the memory used by the file system and increases the number of available Flash pages. The fdefrag function is in the RL-FlashFS library. The prototype is defined in rtl.h. Note - Invoke this function only when the system is in an idle state and no files are open. If files are open, fdefrag aborts the defragmentation.
- The fdefrag function can not defragment a Memory Card drive. If a specified drive is "M:", fdefrag returns an error.
- You may use the fanalyse function to determine if defragmentation is required.
|