The file handling API can be used to manage the SD-card content of a device with t-script capablility. It allows listing files, copying files to and from the device, deleting files and formatting the SD-card (FAT32).
The file system of the SD-card is flat, meaning the files are indexed and stored in sequential order. The functions available for checking the content of the SD-card are kvFileGetCount(), which as the name states retrieves the number of files on the SD-card, and kvFileGetName() which retrieves the filename based on its index. With these the file content of the SD-card can be enumerated.
Example: Enumerate SD-card content.
Files can be copied to the device using the function kvFileCopyToDevice(). Note that since the SD-card is formated using FAT32, a 8.3 formated filename as the target filename should be used. The device only allows flat file structure so no folders can be passed.
Example: Copying files to device.
To instead copy files from the device, use kvFileCopyFromDevice().
Example: Copying files from the device.
To delete files, use kvFileDelete() and pass the name of the file on the SD-card.
Example: Deleting files from device.
To reformat the SD-card, use kvFileDiskFormat(). Full initialization can be done with the kvmlib function kvmDeviceFormatDisk(). Example: Formatting the SD-card.