.getfreespace Method

Function:

Returns the total number of free data sectors available on the flash disk.

Syntax:

fd.getfreespace() as word

Returns:

0-65535, also affects the state of fd.laststatus. The following status codes are possible:

0 — PL_FD_STATUS_OK: Completed successfully.

1 — PL_FD_STATUS_FAIL : Physical flash memory failure (fatal).

2 — PL_FD_STATUS_CHECKSUM_ERR: Checksum error has been detected in one of the disk sectors (fatal).

3 — PL_FD_STATUS_FORMAT_ERR: Disk formatting error has been detected (fatal).

8 — PL_FD_STATUS_NOT_READY: The disk is not mounted.

See Also:

Checking Disk Vitals, fd.capacity, fd.numservicesectors, fd.totalsize, fd.maxstoredfiles, fd.getnumfiles


Details

One data sector carries 256 bytes of file data. Each existing file occupies at least one data sector, even if the file is empty.

The disk must be mounted (see fd.mount) for this property to return a meaningful value.


.getfreespace Method

Details