03-26-2015 08:37 AM
Hi,
I have a strange problem with a Single board Rio:
I need to write a series of bytes (jpg image) to the SD card of the SBRIO.
It works ok as long as I write to the root of the SD Card (u:\test.jpg). Writing speed is around 300-400ms for 1MB, which is acceptable for my application.
However when I try to write to a deeply nested folder (u:\folder1\folder2\folder3\folder4\folder5\test.jpg), things get waaaay slower! It needs around 3000 to 4000 ms to write the file!
How come that writing speed depends on the folder i'm writing to? Is there a way to write, at acceptable speed, to a deeply nested folder?
Thanks for your help!
peper2001
PS: things get even worse when I write to the sbrio drive (c:\): around 5000ms to write 1MB.
03-30-2015 04:06 AM
Have you tried writing to the root of the SD card, and then moving the file to the nested folder?
03-30-2015 04:47 AM
Hi,
Yes I did. In this case the writing of the file is done "quickly" but the moving takes ages (like 4s). So, unfortunately, it is not any better than directly writing to to the deeply nested folder.
I also tried to write data that are a number of the sector size (http://www.ni.com/white-paper/3746/en/) with no better luck.
I've made more tests tough and I think that the problem is not really linked to how deep the file is in the folder hierarchy but rather to how many folders are located at the same level. ex:
Let's say I have a folder hierarchy that is:
u:\root\folder 1
u:\root\folder 2
u:\root\folder 3
...
the problem seems to lie i the fact that there are too many "folder X"... I've read an article that says it's a good idea to limit the number of folder in a folder to 16 (for fat32).
I'm still investigating...
Any help would be appreciated:)
Regards