LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Slow write to deeply nested folder

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.

 

 

 

 

0 Kudos
Message 1 of 3
(2,690 Views)

Have you tried writing to the root of the SD card, and then moving the file to the nested folder?




Certified LabVIEW Architect
Unless otherwise stated, all code snippets and examples provided
by me are "as is", and are free to use and modify without attribution.
0 Kudos
Message 2 of 3
(2,617 Views)

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

 

0 Kudos
Message 3 of 3
(2,609 Views)