FSRW buffer size
William50
Posts: 22
I am writing files that are typically 17k - 30k in size. Currently I am writing blocks of 512 to the sd card at a time and have adjusted the FSRW buffer size accordingly.
Is there a more efficient way to do this? Such as writing larger chunks at a time?
Is there a more efficient way to do this? Such as writing larger chunks at a time?
Comments
Consider switching to this (http://obex.parallax.com/object/16) SD card driver which is a little faster than FSRW, particularly if you're writing 512 byte blocks aligned on a 512 byte file boundary. It's a little bigger than FSRW, but you can leave out the pieces that you don't need for your application.
I do have one other issue with FSRW.
I can not consistently get a return value whenever I invoke a command such as: error=sdpwrite(@buffer,n)
Shouldn't the variable "error" have a return value indicating whether the operation was successful?
{{
' Write count bytes from the buffer ubuf. Returns the number of bytes
' successfully written, or a negative number if there is an error.
' The buffer may be as large as you want.
}}