purduesigbots/pros-docs

Filesystem tutorial sample code does not read or write to "example.txt"

SizzlinSeal01 opened this issue · 2 comments

What went wrong:
If you copy the sample code in the filesystem doc (https://github.com/purduesigbots/pros-docs/blob/master/v5/tutorials/topical/filesystem.rst) it does not print values to an existing file or read values from an existing file.

What was expected
For the sample code to print Example text

Additional Information
When you run the program once, it executes the code (I know because I made it print something to the brain screen after executing the sample code), although it does not read or write anything from the file as it does not output properly, and if If example.txt was not created if it did not exist. You then exit the program and run it again, it never prints something to the brain screen, meaning that some line of code is blocking. example.txt was also not manipulated at all (nothing was written in the file. Exiting and running the program for a third time restarts this cycle

is the SD card formatted with FAT?

Might've been fixed with the proper renaming of the file handle.