I got it! It was actually a lot easier than I thought, I don't have to pass SD as the file system or anything or use any pointers, call functions, complex code etc. All I had to do was add in the card type and card size in my code (for some reason that lets you write to the SD card with SD.open, I think it's because you need to initialise the card type in the code for the board to identify the card type), and use file_append as opposed to file_write, as file_write overrides any text in the file with the ESP32, whereas the standard nano does not do that. Thank you for helping me with this problem, I was losing interest in using the ESP32 very quickly!