1.2.7.4.43 SYS_FS_DriveSectorGet Function
1.2.7.4.43 C
SYS_FS_RESULT SYS_FS_DriveSectorGet
(
const char* path,
uint32_t *totalSectors,
uint32_t *freeSectors
);
1.2.7.4.43 Summary
Obtains total number of sectors and number of free sectors for the specified drive.
1.2.7.4.43 Description
Function to obtain the total number of sectors and number of free sectors in a drive (media).
1.2.7.4.43 Precondition
The drive for which the information is to be retrieved should be mounted.
1.2.7.4.43 Parameters
| Parameters | Description |
|---|---|
| path | Path to the volume with the volume name. The string of volume name must be preceded by "/mnt/". Also, the volume name and directory name must be separated by a slash "/". |
| totalSectors | Pointer to a variable passed to the function, which will contain the total number of sectors available in the drive (media). |
| freeSectors | Pointer to a variable passed to the function, which will contain the free number of sectors available in the drive (media). |
1.2.7.4.43 Returns
SYS_FS_RES_SUCCESS - Sector information get operation was successful.
SYS_FS_RES_FAILURE - Sector information get operation was unsuccessful. The reason for the failure can be retrieved with SYS_FS_Error.
1.2.7.4.43 Example
uint32_t totalSectors, freeSectors; SYS_FS_RESULT res; if(SYS_FS_Mount("/dev/mmcblka1", "/mnt/myDrive", FAT, 0, NULL) != SYS_FS_RES_SUCCESS) { // Failure, try mounting again } else { // Mount was successful. // Do other FS stuffs. } // Perform usual FS tasks. //.... //.... // Now, determine the total sectors and free sectors res = SYS_FS_DriveSectorGet("/mnt/myDrive", &totalSectors, &freeSectors); if(res == SYS_FS_RES_FAILURE) { //Sector information get operation failed. }
1.2.7.4.43 Remarks
None.
