namespace
#include <pros/misc.hpp>
usd
Contents
- Reference
Functions
-
std::int32_t pros::
usd:: is_installed(void) - Checks if the SD card is installed.
-
std::int32_t pros::
usd:: list_files(const char* path, char* buffer, std::int32_t len) - Lists the files in a directory specified by the path Puts the list of file names (NOT DIRECTORIES) into the buffer seperated by newlines.
Function documentation
std::int32_t pros:: usd:: is_installed(void)
Checks if the SD card is installed.
Returns | 1 if the SD card is installed, 0 otherwise |
---|
Example
void opcontrol() { printf("%i", is_installed()); }
std::int32_t pros:: usd:: list_files(const char* path,
char* buffer,
std::int32_t len)
Lists the files in a directory specified by the path Puts the list of file names (NOT DIRECTORIES) into the buffer seperated by newlines.
This function uses the following values of errno when an error state is reached:
EIO - Hard error occured in the low level disk I/O layer EINVAL - file or directory is invalid, or length is invalid EBUSY - THe physical drinve cannot work ENOENT - cannot find the path or file EINVAL - the path name format is invalid EACCES - Access denied or directory full EEXIST - Access denied EROFS - SD card is write protected ENXIO - drive number is invalid or not a FAT32 drive ENOBUFS - drive has no work area ENFILE - too many open files