Mounting the Flash Disk
The flash disk will not be accessible unless it is mounted using fd.mount. It can only be mounted after the flash memory has been successfully formatted using fd.formatj (recommended) or fd.format. The disk has to be mounted after every reboot of your device (if you need to access it, of course). After the disk is mounted successfully, the fd.ready read-only property will read 1 — YES.
During mounting, the fd. object accesses the BOOT sectors of the disk, reads the size of all disk areas, and determines if the flash disk is healthy. This does not include detailed checks of each file or the data sector of the disk, but is enough to "catch" gross problems, such as disk corruption due to an increase in the application size.
There is no way to explicitly dismount the disk, nor it is necessary. The disk will be dismounted (and fd.ready becomes 0 — NO) if:
- Any fatal condition is detected when working with it. This condition will be reflected by the fd.laststatus read-only property. Not every error indicated by fd.laststatus is fatal (see Status Codes).
- The disk is formatted using fd.formatj or fd.format.
- Your application invokes fd.setbuffer or fd.setsector inappropriately.