stat, fstat or f_stat? #357
Replies: 2 comments 5 replies
-
Hi Kevin, when you use circle-stdlib, you should use Rene |
Beta Was this translation helpful? Give feedback.
-
I'm still digging around with filesystems and trying to get to grips with the different options. On MiniDexed we're finding that it can be a little slow to load in lots of small files (which is sort of expected), but curiously it also appears to be slower for files that are indexed later in the directory. Some discussion here: probonopd/MiniDexed#456 (reply in thread) Is this expected behaviour? i.e. is this a symptom of serially accessing the SD card or FAT data structures for example, or could there be something resetting that shouldn't need resetting (like re-seeking from the start of a file/structure every time)? I'm digging around in all this, but to be honest, don't really know at this stage exactly what file system code is used in MiniDexed. Some was using the fatfs/ff.h interface, but some other code is using fopen/opendir too. It is the latter code showing the weird timing and I have tried rewriting it to use f_open/f_findfirst and so on and it still seems to do the same. Thanks for any thoughts and pointers! Kevin |
Beta Was this translation helpful? Give feedback.
-
I'm struggling to work out which of stat, fstat or f_stat (or indeed something else) to use to get the size of a file on an SD card. The file is opened using fopen and that seems to work fine. I see that the library is provided by circle-stdlib/newlib, but with all the architectural options in these external projects, I'm struggling to work out what is supported in circle on the RPi.
I've tried using sys/stat,h and stat,() but that seems to be returning an error for me at the moment. Before I get too far into debugging it, I just wondered if there was any advice on the preferred method to use.
Thanks,
Kevin
Beta Was this translation helpful? Give feedback.
All reactions