B4R Question SOLVED SD. How to create a directory tree.

tigrot

Well-Known Member
Licensed User
Longtime User
Hi everybody,
since there is no directory handling in rSD library, how can I create my directory tree?
I have seen that sd library included in Arduino environment includes mkdir() and rmdir() and is referenced by rSD.

Regards
Mauro Zanin
 

tigrot

Well-Known Member
Licensed User
Longtime User
Hi Erel, I updated the SD library in Arduino environment and substituted the rSD library. I can write and read files(in root) but mkdir seems not to work.
This is my code:
B4X:
Main.sd.MKDir("/logmetalim")
Main.sd.MKDir("/logmetalim/segnala")
I have read that the second mkdir could suffice, since the whole tree is created at once, differently from other enviromnents.
I have also tried to call mkdir from inline code and got no result. But my code could be wrong...
 
Upvote 0

tigrot

Well-Known Member
Licensed User
Longtime User
I moved the directories' creation in AppStart. No way to create directories. In my test sketch everything is good. I upload my whole project for your reference.
Thank you for help
 

Attachments

  • datalogger.zip
    13.6 KB · Views: 356
Upvote 0

tigrot

Well-Known Member
Licensed User
Longtime User
No conflict... I reintroduced the Windows names(10 bytes long) for directory. 8.3 is the max for Fat16/32. reducing the directory's name length to 8 is working.
The strange that directory creation seems to work only at the very first beginning, but it's a wise solution, because it's were it should be.
Thank you for support.
Mauro
 
Upvote 0
Top