sdEx with t3.5 add struct to single file problem

Status
Not open for further replies.

Frankthetech

Active member
I have a logging code that writes a struct of 44 bytes (a simple database) to a single file. Each write is just added to the end of the file.
In my main code I just call dataBase.openCreate(dbName) where dbName is the path.
Works like it should, the databaseEx library (see attached) handles writing the struct to the file.

So I've noticed a problem, goes fine for a long while then just stops writing to the file.
Upon looking into this I found in one case it seems to get to 63035 bytes into the file then stops adding more struct writes.
This is 123 (512) blocks in and then no more data.
Now I have other units and the problem is the same but it happens at different places in the file.
Always at some 512 block boundary, this might be a clue as to what is causing the problem.
Has anyone come across anything like this?
 

Attachments

  • DatabaseEx.h
    1.4 KB · Views: 45
  • databaseEx.cpp
    3.6 KB · Views: 49
Update, turns out its not so much a write problem. I set a test up and was able to write well over 10000 44byte structs to a single file no problem.
Must be a glitch in another part of the program.
This post can be deleted!
 
Status
Not open for further replies.
Back
Top