TinyCircuits

SdFat and directories

dulsi

SdFat and directories
« on: June 13, 2018, 07:05:59 AM »
For my color monster game, I've been looking into SdFat. I've been able to write to a file in the root directory. I haven't been able to write a file in a subdirectory. I'd much rather save information in the game directory than in root. I did tried this:
Code: [Select]
dataFile.open("colormonster/colormn1.dat", O_WRITE | O_CREAT | O_TRUNC)Anybody know what I'm doing wrong?

dulsi

Re: SdFat and directories
« Reply #1 on: June 14, 2018, 10:09:38 PM »
I downloaded the source code to SuperOteme. I copied the SdFat library from it. That works. I'm not pleased with this solution as I don't want to keep a copy of that source in my project. It also makes it difficult for my simulator to support it.

Has anyone gotten the SdFat library in Arduino IDE working? Do I need to initialize it differently or maybe alter the SdFatConfig.h settings?

dulsi

Re: SdFat and directories
« Reply #2 on: June 16, 2018, 11:09:55 AM »
Grrr... The SdFat library I copied from SuperOteme is not working. It creates the file in the subdirectory but fails to write to it. I'm unsure if it did work and started failing or if I never checked the file size and it never worked.

For the time being I've gone back to the Arduino IDE SdFat library and store files in the main directory.

Re: SdFat and directories
« Reply #3 on: June 20, 2018, 03:47:27 AM »
Please use SdFat in the new version of SuperOteme.(SuperOteme103_source.zip)
http://daimonsoft.info/kuran_kuran/index.php?TinyArcade%2FSuperOteme
« Last Edit: June 20, 2018, 06:00:09 AM by kuran_kuran »

dulsi

Re: SdFat and directories
« Reply #4 on: June 23, 2018, 12:13:11 AM »
Please use SdFat in the new version of SuperOteme.(SuperOteme103_source.zip)
http://daimonsoft.info/kuran_kuran/index.php?TinyArcade%2FSuperOteme
That does work. I started comparing parts of the code to the Arduino SdFat library. I believe I found the issue. Unfortunately this means I have to tell people to install the library and then fix it or include a copy in my code. I don't like those options.

dulsi

Re: SdFat and directories
« Reply #5 on: June 23, 2018, 09:44:09 AM »
SdFat developer has checked in my fix. SdFat 1.0.6 should work.