Rewrite the configManager's code, along with the interaction of the SD card reader, and similar code.
(Prefer Vex API, but you can use std::filesystem.)
brain.SDcard
(loadfile() The loadfile(filename, buffer, len) method loads the named file. If the optional bytearray is None, then an empty file is created. Parameters Description filename The name of the file to read. buffer A pointer to a place in memory where file data will be stored. len The length of the buffer in bytes. Returns: A bytearray with the file data.
is_inserted() The is_inserted() method returns the status of the SD Card. Returns: True if an SD card is inserted into the brain. False if it is not. size() The size(filename) method returns the size in bytes of the named file. Parameters Description filename The name of the file to check. Returns: The size of file in bytes. savefile() The savefile(filename, buffer, len) method saves a bytearray into a named file. If the optional bytearray is None, then an empty file is created. Parameters Description filename The name of the file to write. buffer A pointer to a place in memory where file data will be stored. len The length of the buffer in bytes. Returns: The number of bytes written. // Write the bytearray into a file. Brain.SDcard.savefile('MyTextFile.txt', bytearray("Hello ")) appendfile() The appendfile(filename, buffer, len) method appends a bytearray into a named file. Append is used to add more data to an existing file. Parameters Description filename The name of the file to write. buffer A pointer to a place in memory where file data will be stored. len The length of the buffer in bytes. Returns: The number of bytes written. # Append the bytearray into a file. Brain.sdcard.appendfile('MyTextFile.txt', bytearray("World ")) size() The size(filename) method returns the size in bytes of the named file. Parameters Description filename The name of the file to check. Returns: The size of file in bytes. exists() The exists(filename) method checks to see if the named file exists on the sd card. Parameters Description filename The name of the file to check. Returns: true if file exists. false if it does not exist.
Is the Vex API. Any other tasks will require std::filesystem, but you cannot make folders due to a partial implementation
of newlib, (directory creation would give you FR_NOPATH), including some of the FFS/io functions. )
Rewrite the configManager's code, along with the interaction of the SD card reader, and similar code.
(Prefer Vex API, but you can use std::filesystem.)
brain.SDcard
(loadfile() The loadfile(filename, buffer, len) method loads the named file. If the optional bytearray is None, then an empty file is created. Parameters Description filename The name of the file to read. buffer A pointer to a place in memory where file data will be stored. len The length of the buffer in bytes. Returns: A bytearray with the file data.
is_inserted() The is_inserted() method returns the status of the SD Card. Returns: True if an SD card is inserted into the brain. False if it is not. size() The size(filename) method returns the size in bytes of the named file. Parameters Description filename The name of the file to check. Returns: The size of file in bytes. savefile() The savefile(filename, buffer, len) method saves a bytearray into a named file. If the optional bytearray is None, then an empty file is created. Parameters Description filename The name of the file to write. buffer A pointer to a place in memory where file data will be stored. len The length of the buffer in bytes. Returns: The number of bytes written. // Write the bytearray into a file. Brain.SDcard.savefile('MyTextFile.txt', bytearray("Hello ")) appendfile() The appendfile(filename, buffer, len) method appends a bytearray into a named file. Append is used to add more data to an existing file. Parameters Description filename The name of the file to write. buffer A pointer to a place in memory where file data will be stored. len The length of the buffer in bytes. Returns: The number of bytes written. # Append the bytearray into a file. Brain.sdcard.appendfile('MyTextFile.txt', bytearray("World ")) size() The size(filename) method returns the size in bytes of the named file. Parameters Description filename The name of the file to check. Returns: The size of file in bytes. exists() The exists(filename) method checks to see if the named file exists on the sd card. Parameters Description filename The name of the file to check. Returns: true if file exists. false if it does not exist.
Is the Vex API. Any other tasks will require std::filesystem, but you cannot make folders due to a partial implementation
of newlib, (directory creation would give you FR_NOPATH), including some of the FFS/io functions. )