(I have written the .ToStrings() method as an extension to string[] and it just prints each string on a newline).
For some reason, SDCard.ListRootDirectorySubdirectories() works but SDCard.ListFiles(SDCard.RootDirectory + directories[0]) does not. I’m following the way it is dont on the SD Card Module tutorial here (https://www.ghielectronics.com/docs/96/sd-card-module).
Does anyone know why this isn’t working?
Thanks for your time.
P.S. The card is FAT and I know it is being read because I can print the string[] returned from SDCard.ListRootDirectorySubdirectories();
By not working I mean what I say in my original post, it just gives me a System.IO.Exception and if I catch it the Message is ‘file not found’ or ‘directory not found’ depending on if I use GetDirectories() or GetFiles().
Haha, I am powering it with the USB cable as normal but I remember in the past this working fine (although I was using the module with a spider not a cerberus).
If I can get a list of root directory files and directories, is it a power issue? It’s able to get those, but just not if I ask for the files and directories in any other directory.
should not have SDCard.RootDirectory + “” in it. ListFiles expects a path without the root. You just need to pass in the directories returned by ListDirectories directly, like
Looking at the tutorial it made me think I needed SDCard.RootDirectory put at the start of the path string, thanks everyone for the help and I’m glad to have it working now