SdFat and directories

dulsi · 6 · 6837

dulsi

  • Full Member
  • ***
    • Posts: 34
    • View Profile
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

  • Full Member
  • ***
    • Posts: 34
    • View Profile
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

  • Full Member
  • ***
    • Posts: 34
    • View Profile
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.


kuran_kuran

  • Full Member
  • ***
    • Posts: 21
    • View Profile
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

  • Full Member
  • ***
    • Posts: 34
    • View Profile
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

  • Full Member
  • ***
    • Posts: 34
    • View Profile
SdFat developer has checked in my fix. SdFat 1.0.6 should work.


 

SMF spam blocked by CleanTalk