When calling FATEngineStart , the fifth parameter affects the readOnly setting. Set to anything other than 0 and you can't write to the card.
fat.FATEngineStart(_SD_DO, _SD_CLK, _SD_DI, _SD_CS, 0)
fat.mountPartition(0)
fat.newFile(string("test.txt"))
fat.closeFile()
fat.openFile(string("test.txt"),"w")
fat.writeString(string("this is file test.txt"))
fat.closeFile()
fat.openFile(string("test.txt"),"r")
fat.readData(@buffer,fat.fileSize())
debug(zstr(@buffer))
Refer to this forum post for object files: https://forums.parallax.com/discussion/175711/cant-get-the-fat32-object-to-create-a-new-file